Re: copy only files that have changed?
Quote:
Originally Posted by
garyed
I understand that but what I don't understand is which of those switches tells it to copy only files that have changed. I've checked every one of those switches & I don't see any one of them that will do that. Is there something undocumented or can someone explain it to me?
I think that is inherent in rsync itself. Those are the settings I've been using for years and it does copy only the files that have changed. However, I do know that using rsync by itself without any switches does nothing.
Re: copy only files that have changed?
Quote:
Originally Posted by
papibe
This is how it works:
It all start by making a full backup (or mirror) of your source directory. If you do a regular rsync again, you would update the destination, but the previous version of the backup-ed data would be overwritten.
Another approach is to do a differential backup: leave the full backup intact, and create a new directory with only the content that has change on the source.
A typical rsync implementation has this structure:
Code:
rsync -av --compare-dest=full_back_up original_source/ new_differential_backup/
rsync will follow this logic: (1) go to original_source and take the first file; (2) check if the file exist in the full_backup; (3) if exist and haven't change, stop and fetch the next file from original_source; (4) if it does not exist or has changed, then copy it into new_differential_backup.
Does that clarify things a little bit?
Regards.
I think I understand now.
That should actually do what I'm wanting to do then.
I want to do incremental backups to a new directory each time so after one full backup I could use that backup directory for the "--compare-dest=" directory to find what has changed & the copy only the changed files to a new directory.
Re: copy only files that have changed?
Quote:
Originally Posted by
Lars Noodén
I think that is inherent in rsync itself. Those are the settings I've been using for years and it does copy only the files that have changed. However, I do know that using rsync by itself without any switches does nothing.
That makes sense to me now. I always used the -u switch but its really not needed unless you want to make sure you don't overwrite any newer files that are already on the destination folder.