LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-19-2012, 01:18 PM   #1
Clarkman
LQ Newbie
 
Registered: Mar 2011
Posts: 9

Rep: Reputation: 0
How to tell rsync to skip older files?


We have directories containing both older and newer files. Our rsync execution time would be significantly cut if rsync had an option like find's -mtime or -newer, where rsync would skip bothering with a file unless it was more recent than say:

-mtime 60 (sixty days or older), etc.

Is such a thing possible? A good idea?

THANKS!
 
Old 04-19-2012, 01:23 PM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,565

Rep: Reputation: 410Reputation: 410Reputation: 410Reputation: 410Reputation: 410
Use a find statement within rsync or use xargs with find:

Code:
rsync -avz -e ssh --files-from=<(find -mtime +30 -mtime -60) source dest
 
Old 04-19-2012, 01:26 PM   #3
Clarkman
LQ Newbie
 
Registered: Mar 2011
Posts: 9

Original Poster
Rep: Reputation: 0
Awesome! Thank you so much!
 
Old 04-19-2012, 01:47 PM   #4
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,565

Rep: Reputation: 410Reputation: 410Reputation: 410Reputation: 410Reputation: 410
No problem. Please mark the thread as solved unless you have more questions. It is under thread tools at the top of the thread.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync can not rsync files with include filter... xiutuo Linux - Server 2 07-23-2010 02:10 AM
Could I run rsync to download files from a server without rsync daemon? Richard.Yang Linux - Software 1 09-18-2009 04:08 AM
rsync syntax to skip directory, but copy select files.. tnicol Linux - Software 3 07-24-2007 05:40 AM
Command to copy files/folders but skip bad/corrupt files?? leemoreau Linux - Newbie 2 04-02-2007 02:27 PM
How to make RSYNC skip a directory due to error message ArchW Linux - Networking 5 07-13-2006 10:26 AM


All times are GMT -5. The time now is 04:08 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration