Originally Posted by pan64
Sorry, still does not understand. rsync is used to make incremental backup. It means you will always save only the new/modified files, the old ones will not be backed up again. Every time you make a backup you will create it in a new directory, and all the earlier backups will remain intact.
I think he wants to back up the old files on the destination before syncing them to the new files
In other words, he has machine A and machine B.
Machine A backs up to B using rsync
A backup is performed on Sunday
"filename.txt" on machine A is changed on Monday
Before he runs the rsync to sync up A and B, he wants to make a backup of "filename.txt" on B, so that when the backup is done, B has both copies of "filename.txt", the new one that matches A, and the old one from Sunday.
OP - look into the --link-dest flag in rsync. The basic idea is that you would perform a full backup from A to some dated directory on B, then the next time you did the backup, you would set --link-dest to the previous backup. Then when the backup is performed, any files that are UNCHANGED on the source, would simply be hard linked from the previous backup on the destination, while any files that are changed on the source are copied like normal. In the end, you have two full backups, one from the previous day and one from the current day, but it only takes up the hard drive space of one backup plus any files that changed between the two backups, since the unchanged files are hard-linked between the two.