Score:0

Rsync directory error

om flag

I wanted to copy files that are made 15 and more days ago. Here is the code im currently using

rsync -RDa0P \
    --files-from=<(find /vmail/folder1/ -mtime +15 -print0) \
    . [email protected]:/vmail/folder1/

The find part did show all the files:

/vmail/folder1/folder11/file15,
/vmail/folder1/folder11/file16

but when the code above is issued, it gives an error failed: No such file or directory (2). And the directory was changed, root was added :

rsync: link_stat "/root/vmail/folder1/folder11/cur/ failed: No such file or directory (2)"

Am i missing something? Any help is appreciated!

Score:1
cn flag

You should pipe your file list:

find /vmail/folder1 -mtime +15 -printf '%P\0' | \
rsync -vRDa0P --files-from=- /vmail/folder1 [email protected]:/vmail/folder1
bac0n avatar
cn flag
Remember to take the rounding effect into account, meaning, any fractional part is ignored, so to match `-mtime +1`, a file has to have been modified at least two days ago.
user13539846 avatar
om flag
Okay this is great! Also fixed the problem I encountered after I troubleshoot my command above. Thanks!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.