tags:

views:

215

answers:

1

Hi,

I have two questions with respect to rsync:

1: I have a bunch of files which are incremented by day of the year. Ex: file.txt.81, file.txt.82, etc. Now, these files are in different directories:

data1/file.txt.81 data1/file.txt.82 data2/file2.txt.81 data2/file2.txt.82

How can I have rsync get only the *.82 files and not even touch the other files

2: Now I have a similar data directory structure as above. How can I rsync all files that have been modified on or after a specific day?

Thanks

+1  A: 

Here is the answer for #1rsync -avz --include "**/" --include=*.82 --exclude=* /path/from /path/to

This will recursively (-a) include the directories and search them for anything matching .82 and exclude everthing else. You can find more info on this in man rsync and look for "exclude patterns"

For #2 I would find some way to do it with find and mtime. To find files modified in past 60 minutes with the name *.82 this should work: sudo find /path/from -mmin 60 -type f -name *.82

EDITED: too many backticks

paulusdd