Link to home
Start Free TrialLog in
Avatar of StorageandUNIX
StorageandUNIX

asked on

I am trying to rsync

I need to rsync files that are less than 365 days old to my box.  

I set up ssh with a private key of the user on the receiving box to connect to the source.
I am on the source.  A regular rsync will work, but they want only files that are 365 days and less moved to the receiving box.  

This works: rsync -av --recursive user@host:/tmp/  /tmp/   .... but they want only files that are 365 days and less.   Can I incorporate a find command in the syntax?

CENTOS 6.7
Avatar of slubek
slubek
Flag of Poland image

I don't have an access to my unix box now, but maybe something like:
rsync ... --files-from=<(find ./ -mtime -365) ...

Open in new window

should do the job.
Avatar of StorageandUNIX
StorageandUNIX

ASKER

I think I tried that syntax  

PULL while on source from Remote host executing find on the remote host:

rsync -avz -e "ssh --files-from=<(find -mtime -365) id@host:/sourcedirs   /destination

IT Errors out
I meant PULL while on destination host from Remote host
ASKER CERTIFIED SOLUTION
Avatar of slubek
slubek
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you!