What is the best solution for daily backup of Linux folder to NAS server over WAN? Here is the situation: My customer has expressed a wish that source code for his project must be backed up every day on my local server and then exported to his NAS. He gave me access to NAS via FTP protocol, and now I want to use cron scheduler for ftp upload to his server. Is this OK, and how is this done?
Best solution advice for backup to NAS over WAN
ubuntu;backup;nas
As per comments rsync is a good tool to use.  Basic rsync usage simply mirrors a directory.  For example:rsync -a --delete /source/dir /backup/dirWill make the backup directory match the source; if there is stuff in the backup that isn't in the source, it will be deleted (--delete), and if there is stuff that is in both, it will be updated in the backup if the timestamp in the source is more recent (i.e., the file has changed).Note you can also use rsync via SSH if you don't have the remote directory locally mounted (and the NAS machine also runs an ssh server).rsync -a --delete user@ip:/source/dir /backup/dirThis requires that you keep the mirror directory on your backup machine.  If you want rolling backups, you could then archive and compress this:tar -cjf  backup.tb2 /source/dirThis can then be extracted with tar -xjf backup.tb2.  To prevent each backup from overwriting the last, you could use a timestamp:tar -cjf backup.`date +%m%d%y`.tb2 /source/dirThis will produce a filename with a MMDDYY timestamp in it such as backup.030814.tb2.So, that's a two line script you can execute daily via cron.