The UNIX and Linux Forums  


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




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

Join Date: Apr 2008
Posts: 92
scan and move

i have a script to look for a file, but it moves a file that's being used.

i want to use:

if file exists > 0, and not being updated/used in the last 2 minutes, move to /tmp

i can do this much:

if [ -s filename.txt ]
then
mv filename.txt /tmp
else
exit
fi

or how can i check if filename.txt is being used ?