The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > UNIX Desktop for Dummies Questions & Answers
.
google unix.com



UNIX Desktop for Dummies Questions & Answers Discuss UNIX and Linux user interfaces like GNOME, KDE, CDE, and Open Office here. All UNIX and Linux Newbies Welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Getting yesterday DATE osymad Shell Programming and Scripting 19 09-23-2009 03:39 PM
How to get the date yesterday in AIX sh victorcheung AIX 4 03-31-2009 06:34 PM
How to copy set of files with date appended to their name sish78 UNIX for Dummies Questions & Answers 7 07-07-2008 06:21 PM
yesterday date month/date skully Shell Programming and Scripting 5 06-24-2008 06:51 AM
copy files with date isingh786 HP-UX 1 03-10-2006 05:04 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-28-2009
Colel2 Colel2 is offline
Registered User
  
 

Join Date: May 2009
Posts: 4
Question Using the find command to copy yesterday date only files

Hello. Newbie is too advanced a description for me when it comes to Unix script writing, so I do everything the hard way by using multiple 'single' line commands.

I am trying to copy off log files to an 'archive' folder, then compress them to preserve disk space. However, I want to add a cron job that would do this nightly for any newly created log files.

I most familiar with the 'Find' command. I want to use that to copy files created just yesterday, nothing older. Then I figure I will use another cron job to compress the newly added files.


I've seen many suggestions on this site but they either contain a specific date value ex: "Apr 14" or the command includes everything that is yesterday's date plus older.

Here is my starting command:
find ./ -type f -ctime +7 -exec cp -p {} ./archive/ \;

I've manned 'find', 'ctime' and 'mtime' and I can't find what I'm looking for.

Does anyone have an answer? Or know if this is possible? If not possible, can someone please offer a script solution?

Thanks!!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:43 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0