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 > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-02-2009
cravie cravie is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 2
Watch and copy a file

I need to write a simple shell script to watch a file in a directory and copy immedietly any files in that directory to another oldfiles directory once and later in the evening delete the file from the original directory.

File A arrives in dir1 at 8.00AM
Watch the file in dir1 and copy the file immedietly by appending time to another oldfiles directory.
Leave the orig file in dir 1 until end of day. End of day move the file to a directory called deleted with timeappend.

Need to keep a track of what time the file came. The file triggers some other process , so need to keep in the original directory for the whole day and move it in the evening.

This has to be done 24X7