hi guys, got a small trick to share with you
i wanted to backup my users' samba profiles/data/files on daily basis and need an automatic way to do it
before this, i've had a cronjob setup as
@weekly /home/user1/cronjobs/testcron.shwhere testcron.sh has
tar -cvf /backup/profiles_$(date +%Y%m%d_%H%M%S).tar /home/samba/profilesin it. Now I've created a new testup.sh with
#!/bin/sh
# testup.sh
#################################
tar -cvf /backup/profiles_$(date +%Y%m%d_%H%M%S).tar /home/samba/profiles
curl -u yourFTPuser:yourFTPpass -T /backup/profilesBU_$(date +%Y%m%d)* ftp://yourFTPhost/profiles_$(date +%Y%m%d_%H%M%S).taradd this with @daily and it'll run each day so u don't have to manually backup the user data anymore. Perhaps not too elegant, but it does the job just fine.
Happy digging (linux/ubuntu/zent)
Credit goes to
http://stackoverflow.com/questions/814322/how-to-use-linux-command-line-ftp-with-a-sign-in-my-usernameI was looking into sftp, but then it's way too complicated for an auto method, u need to add ssh-keyring and what not. curl seems to be doing the job just fine. I unno about the security issue, if there is one, though.
And it's better to create an separate account, for a specific folder outside of the public_html area.