Forum Moderators: bakedjake

Message Too Old, No Replies

rsync is copying files that I didn't expect

         

csdude55

8:47 am on Dec 25, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Am I misunderstanding something, or is there a typo here somewhere?

I still have a few people pinging my old VPS, so I've been running this every few hours to copy over any images they've uploaded:

rsync -avu --progress -e 'ssh -p 1234' --exclude={'foo','bar'} root@123.45.67.89:/home/example/www/ /home/example/www/


I'm always seeing a LOT more images than I expect, though. From 1am until 3am, it copied 6 images! I expected more like 2 or 3 a DAY, so 6 during off-peak hours is way too much!

Then I dug deeper, and saw that the images it copied over weren't new at all! The last modified date for one of them was 3:37:23pm on Dec 21. It's too late to see the last modified date on the new VPS from before I copied them, of course, but right now they match :-(

There were 137 on the old VPS that are new than that. And there have been 1,301 newer files (user uploaded) added to the new VPS since then.

Am I correct in thinking that -u is supposed to only copy over files that are newer than at the source?

If so, why is it still grabbing old files?

robzilla

9:40 am on Dec 25, 2020 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You could use --ignore-existing instead of --update (-u). But you don't want people writing to the same file on different servers, of course.