Ubuntu – Using rsync to backup to two locations

backuprsync

Please forgive my ignorance, I have searched for an answer but have so far come up blank.

Here's what I want to do:

Use rsync to backup from the fileserver (Ubuntu Server 14.04) to a NAS device. When this backup is complete then run rsync again to a remote server via SSH.

I have a nagging feeling that this won't work properly – something to do with how rsync marks files as already backed up and not changed since last backup.

Am I right to be suspect that this might cause a problem?

Thanks,

Simon.

Best Answer

From the man page:

DESCRIPTION
   It [rsync] offers a  large  number  of  options
   that  control  every  aspect  of  its behavior and permit very flexible
   specification of the set of files to be copied.  It is famous  for  its
   delta-transfer  algorithm,  which  reduces the amount of data sent over
   the network by sending only the differences between  the  source  files
   and  the  existing  files in the destination.

Out-of-the box, without any special parameters, rsync will do exactly as you need:

  • sync all differences to the NAS and sync all differences to the remote SSH server.
  • The first time you run it, it will create a full copy on both, and then sync the 2 independently.

Even when the connection to the remote server is dropped, it will just continue where it left off next time it's invoked.