Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

Thanks for you help.

share|improve this question
a) I think this does belong to serverfault. – phresnel Jun 14 '11 at 13:53
b) how often do you run rsync? – phresnel Jun 14 '11 at 13:53
the same question is in superuser.com/questions/297304/rsync-files-newer-than-1-week – kokbira Jun 15 '11 at 2:53

migrated from stackoverflow.com Jun 15 '11 at 1:53

1 Answer

up vote 2 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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