5

With rsync command I want only copy/sync changed files/folder to the destination folder. I had some issue with Rsync-like whenever am executing the rsync command am copied along with the time stamp as well.

For example, my destination folder ‘Linux’ had updated on 1 month back and in my source folder there is no update info for the 'Linux' folder, but when am performing the rsync command my destination 'Linux' folder time stamp has been updated with latest source folder time stamp. I don’t want to copy the timestamp. please suggest me on this and please glance on below command which I have used.

rsync -avh /source/Linux/ /destination/Linux/ 

rsync -uan /source/Linux/ /destination/Linux/

rsync -uav /source/Linux/ /destination/Linux/
  • 1
    You do want to copy the timestamps, these will be used when you run rsync next time to find out what has changed. The alternative is to use checksums, which are much slower. – Satō Katsura Jul 13 '16 at 14:55
6

The -a option (--archive) implies the -t option (--times, "preserve modification times").

You may negate this option using either --no-t or --no-times after -a:

rsync -a --no-t /source/Linux/ /destination/Linux/

This would not copy the source timestamps to the destination. Note though, that rsync compares timestamps (and other metadata) to determine whether files are updated and needs copying. You may therefore want to use -u (--update) too.

|improve this answer|||||
  • Thanks for your response Kusalananda. I have already tried like- rsync -rlpgoD /source/Linux/ /destination/Linux/. Actually -a represent -rlptgoD so on this I have eliminated the 't' option and tried but no luck. – Raja Jul 13 '16 at 11:39
  • rsync -rlvi sets all the file modification timestamps to now.. I think the goal was to not change them at all. – adfaklsdjf Jun 12 '19 at 13:48
  • @adfaklsdjf Note that "not copying the remote timestamps" is not the same as "preserving the timestamps locally". My answer concerns "not copying the remote timestamps", as this is what the user asks about. – Kusalananda Feb 21 at 14:44

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.