The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
mtime ravi raj kumar Shell Programming and Scripting 7 03-01-2007 08:54 PM
mtime help!!!!! scooter17 UNIX for Dummies Questions & Answers 2 09-12-2006 02:24 PM
find . -mtime topcat8 UNIX for Dummies Questions & Answers 1 04-26-2006 10:55 AM
find -mtime off by one day? ceanntrean UNIX for Dummies Questions & Answers 4 08-24-2005 07:46 PM
mtime vs ctime moxxx68 UNIX for Dummies Questions & Answers 3 11-06-2004 10:57 PM

Closed Thread
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
  #1 (permalink)  
Old 12-17-2007
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
How do files appear in the directory, are they copied or moved/renamed.

If copied, then how are you going to avoid copying a half copied file?
  #2 (permalink)  
Old 12-17-2007
bbbngowc bbbngowc is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 194
Somethine like this?

find . -type f -newer afterme.txt | cpio -dumv <new directory>
touch -t afterme.txt
  #3 (permalink)  
Old 12-17-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,209
Touch the file once manually. Then after you have found the list of files touch it again.

manually:
Code:
touch my_touch_file
Then in the script:
Code:
find <dir> -newer my_touch_file > listoffiles.txt
touch my_touch_file
cpio -pdumv /somewhere/else < listoffiles.txt
or do it in the background:

Code:
find <dir> -newer my_touch_file | cpio -pdumv /somewhere/else &
touch my_touch_file
wait

Save the list fist, and then feed that into cpio, otherwise you could get a file that will arrive while you are doing the cpio and you'll never retrieve it.

Porter has a point which I was also wondering about, how can you be sure you won't get a partial? If it is longer term storage it doesn't matter since you will get them next time around, but if the files are being processed then you could end up processing an incomplete file.
  #4 (permalink)  
Old 03-17-2009
robinbannis robinbannis is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 17
Alternative for -mmin in SunOS

Hi can some one tell me the alternative for
-mmin command?
Its not working in SunOS

"find . -mmin -30". This works in other machines but not in SunOS.

Please help


Robin Paulose
  #5 (permalink)  
Old 03-17-2009
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
-mmin -30 means 30 or less minutes.
Use touch to set an mtime on a dummy file - the mtime being 30 minutes ago.
Code:
touch -t 200903170800 dummy
find . -type f -newer dummy
Closed Thread

Bookmarks

Tags
cpio, mtime

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 11:27 AM.


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