Friday 22 September 2017

linux - rsync files newer than 1 week


I want to run rsync on server A to copy all files from Server B when they are newer than 7 days.


find . -mtime -7

I don't want to delete the files on Server B.



Answer



This should get you underway in a solid way


rsync -RDa0P \
--files-from=<(find sourcedir/./ -mtime -7 -print0) \
. user@B:targetdir/

This copies device nodes, permissions, timestamps. I'm pretty sure the -H option won't be accurate with --files-from


No comments:

Post a Comment

Where does Skype save my contact&#39;s avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...