ppr
ppr

Reputation: 775

rsync doesn't copy *only* modifications

I'm using rsync to backup my files. I choose rysnc because it (should) use modification times to determine if changes have been made and if files need to be updated.

I started my backup (from my computer system (debian) to a portable external hard drive) with this command:

rsync -avz --update --delete --stats --progress --exclude-from=/home/user/scripts/ExclusionRSync --backup --backup-dir=/media/user/hdd/backups/deleted-files /home/user/ /media/user/hdd/backups/backup_user

It worked well and took a lot of time. I believed the second time would be very quick (since I didn't modify files). Unfortunately, the 2nd, 3th, 4th, ... times took as long as the first one. I still see all my files being copied even if these files are already in my portable hard drive.

I don't understand why rsync doesn't copy only modifications (rsync is known to be efficient and only copy changes and I specificly call --update option).

A side effect of this problem is that all files are moved to my backup dir (deleted-filed) as soon as they are transfered. Indeed, rsync delete the previous file before to copy the same file during each update...

Upvotes: 0

Views: 394

Answers (1)

ppr
ppr

Reputation: 775

I found the solution reading an answer on Serverfault.SE. The Fat filesystem was messing with timestamps:

FAT doesn't track modification times on files as precisely as, say ext3 (FAT is only precise to within a 2 second window). This leads to particularly nasty behavior with rsync as it will sometimes decide that the original files is newer or older than the backup file by enough that it needs to re-copy the data or at least re-check the hashes. All in all, it makes for very poor performance on backups. If you must stick with FAT, look into rsync's --size-only and --modify-window flags as workarounds.

Upvotes: 3

Related Questions