LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-17-2005, 10:16 AM   #1
davholla
Member
 
Registered: Jun 2003
Location: London
Distribution: Mandriva 2008 Spring
Posts: 652

Rep: Reputation: 31
Copy files after a certain date


How can I use cp to copy files after date x ?
I have looked in the man pages but without success.
I have also looked on this site.
 
Old 03-17-2005, 10:24 AM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Something like this example where jpg files that are less than 30 days old are copied to the new folder.
Code:
find /home/images -type f -name '*.jpg' -mtime -30 -exec cp {} /home/new \;
 
Old 03-17-2005, 10:29 AM   #3
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHL9;F1-10; CentOS4-5; DebianSarge-Squeeze
Posts: 1,151

Rep: Reputation: 46
davholla: This may not be exactly what you want to do, but it would be easy to do.

You could create a shell to do the copying and call it as a cron job on whatever frequency you want.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete/move/copy files of specific date imsajjadali Red Hat 26 11-08-2013 12:34 AM
filter files by date novaprime Linux - Software 1 05-31-2005 06:51 AM
Auto Change Date on copy to user folder mariusak Linux - General 4 05-28-2005 07:42 PM
Date-based copy AdmiralThrawn Linux - General 2 02-23-2004 10:03 AM
Removing all files with the same date. Bookmarc Linux - General 1 08-12-2002 04:35 PM


All times are GMT -5. The time now is 10:52 PM.

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