0

I would like to run an rsync job which connects to one server and backs everything up to another. These backups should be incremental and we don't want to delete any files.

Any ideas?

4 Answers 4

2

Check out rdiff-backup and duplicity. Both are for exactly what you want, duplicity also adds encryption layer.

You can do this also with rsync alone, but then you are not saving old versions at all.

rsync -az /local/folder -e ssh username@remote_host:/backup/folder

backups files from /local/folder to remote host. Most probably you want to setup public key authentication, otherwise you have to enter your password each time.

You can put commands to crontab with command crontab -e. Something like

12 03 * * * your_commands
1
  • Thanks, I'll have a look at rdiff-backup looks like it'll do the trick
    – Tom
    Mar 24, 2011 at 14:56
1

set something like this to run on a cron job and it'll make incremental backups with rsync via SSH:

rsync -azvr --rsh="ssh -l theusername -p 22" your.remote.ip.address.or.domain:/remote/path/ /local/path/on/backup/machine/

azvr meaning archive, compress, verbose and go recursively into directories, plus this gives the option of running on a different port (which I had a hard time finding an answer to), plus it saves files on the backup that you later delete on the original

4
  • What happens if the connection goes down half way though a large file or an entire job, is rysnc smart enough to carry on?
    – Tom
    Mar 24, 2011 at 14:55
  • 1
    @Tom: yes, it's. Whole point of rsync is incremental transfers.
    – Olli
    Mar 24, 2011 at 14:58
  • So will rsync actually detect that the connection is broken, wait a little while and restart or do I just run the same command again and it'll pick where it left of?
    – Tom
    Mar 24, 2011 at 15:07
  • If it's on a cron job, it'll just pick it up again when your cron comes around again. But yeah, it'll pick up where it left off. I believe it's a byte-level copy so it'll detect the differences between files so it'll pick up where it left off.
    – jpea
    Mar 24, 2011 at 15:10
0

You may want to look at backuppc which will do rsync backups. It can be configured for incremental and full backups. After the first backup, transfers are incremental. There is a good web-based interface for querying status, backups, and doing recoveries.

0

rsync have many powerfull options. check this link

Example:

rsync -avz --progress --stats -e ssh /home 192.168.1.23:/backup/home

Don'f forget to create SSH keys.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .