If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > I need to move files by hour, it is possible?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-27-07, 12:18
luishdez luishdez is offline
Registered User
 
Join Date: Oct 2005
Posts: 6
I need to move files by hour, it is possible?

I have to make a script that copy files created in last hour.
It is possible?

CTIME= ???
find . -name "$CFILES" -mtime +$CTIME -exec cp -p {} "$CDIR/tmpold" \;
Reply With Quote
  #2 (permalink)  
Old 05-02-07, 06:23
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
+n for older than n
-n for newer than n
To find within last hour
use -cmin -60 if your version of find support it
else use touch -t to create a temp_file with a time of one hour ago
then use find's -newer temp_file
Reply With Quote
  #3 (permalink)  
Old 05-23-07, 14:28
luishdez luishdez is offline
Registered User
 
Join Date: Oct 2005
Posts: 6
Thanks pdreyer.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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