I want to copy the modification dates from my backup to my newly created server (forgot to specify the -p option on cp). As I changed files since I made the copy I only want to have the modification date changed uptill 31 days ago. To copy modification dates I found:

rsync -vrt --size-only /src /dest

I could not find rsync arguments to copy uptill a certain time so another search got me:

rsync --progress --files-from=<(find /src_path -mtime -3 -type f -exec basename {} \;) /src_path/ /dst_path

I tried to figure out the behavior of the -mtime argument of find. To get what I don't want I must specify:

find . -mtime -31

In that way I get the files changed since 31 days ago but I just want to have the files till 31 days ago. Specifying a positive number does not help. Any suggestions?

migrated from serverfault.com Jul 18 at 18:16

This question came from our site for system and network administrators.

  • 5
    It should be find . -mtime +31 (look up -mtime and -atime in the man page for find). – yoonix Jun 17 at 19:22
  • Thanks, that did the trick! – Arnold Jun 17 at 19:54

Your Answer

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

Browse other questions tagged or ask your own question.