søndag den 14. december 2008

Backup to SMB share

Mount smb share on ubuntu:
sudo smbmount //192.168.0.3/backup /smb/r5nas/backup -o username=yyy,password=xxx,uid=500,gid=500

Backup to smb share using rsync (background job):
sudo nohup rsync -azv /data /smb/r5nas/backup > /home/username/log/smb.log &

Watch the output:
tail -f /home/username/log/smb.log

Unmount smb share on ubuntu:
sudo smbumount sambashare

I had some problems with files being copyed even though they weren't changed. It seems like setting modify-window up helps. Also rsync had problems with setting permissions on the files after copy (see links below). I ended up using this combination:
sudo nohup rsync -rltDvhi --modify-window=3600 /data /smb/r5nas/backup > /home/username/log/smb.log &

As an alternative you can backup files using FTP (see the link below) but you will have to copy everything every time you do a backup.

Relevant links:
smbmount
Recursive copy using FTP
rsync FAQ
rsync chown problem

Ingen kommentarer: