New to rsync here. I used it to backup files on an external drive on my home drives. My rsync line is :
sudo rsync -vv -rP /inputFolder ~/backupFolder
I did 2 backups back to back to verify if rsync backed up only files that had been modified, as I understood from what I had read. But to my surprise, the second backup took as much time as the first one, even though no files had changed between both backups.
Important note: the backup is on a samba network drive.
Shouldn't the second backup been much faster since no file had changed since the first one?
You may want to include the
-t
command line argument torsync
, telling it to preserve the time stamps, as otherwise the time stamps are bound to differ, causing files to be transferred anew. Alternatively, you should include-I
to tellrsync
to ignore time stamps. Anyway, you might enjoy some quality time withBy default,
rsync
checks file size and modification time before transferring to check whether the files are identical or not.The
rsync
transfer time is rather misleading for files of same size and modification time, if you dorsync -vvv
then you would seersync
spends most of the time doing the delta transfer check to make sure the files are identical,rsync
does this chunk by chunk. In a nutshell, if the size and modification time remains the same,rsync
won't do a transfer.Also note that you can do a checksum before transfer by using the
--checksum
option.In your case though, as the file sizes are same then it must be the modification time causing the files to be re-transferred. This is justified as you have used no option that preserves modification time on
rsync
.You can use -t (
--times
) option to preserve modification time or -a (--archive
) option that includes-rlptgoD
options together: