1

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?

0

By 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 do rsync -vvv then you would see rsync 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:

sudo rsync -vv -trP /inputFolder ~/backupFolder

sudo rsync -avvP /inputFolder ~/backupFolder
  • The commands I use are : rsync -vv -trOP folderA folderB; rsync -vv -trOP folderB folderC – frepie Dec 17 '15 at 0:56
  • Somehow A->B works fine (no synching when no changes) but B->C ALWAYS syncs, even when no change to any file has been made. 1 detail that might come to play here : C is on a samba drive and all drives are NTFS. – frepie Dec 17 '15 at 1:07
0

You may want to include the -t command line argument to rsync, 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 tell rsync to ignore time stamps. Anyway, you might enjoy some quality time with

man rsync
  • -1..considering you are referring timestamp to mod time by as you have used -t``the time stamps are bound to differ - why is that? – heemayl Dec 6 '15 at 5:29
  • Yes, the time stamp is the mod time of the file. rsync-ing from one place to another is of course a file copy, and the destination file (although named the same) will then gain its on mod time, unless rsync is told (by -t) to "correct" it to be the same as the mod time of the source file. – Ralph Rönnquist Dec 6 '15 at 5:37
  • My bad..downvote removed..i was rolling back my edit and saw this and missed the initial case.. – heemayl Dec 6 '15 at 5:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.