Select files by time stamp

Hi,

I need help to read file in a directory on basis of time stamp.
e.g. If file access in last 2 minutes it should not be copy to remote directory.

Below is my script.

+++++++++++++++++++++++++

#!/bin/ksh
 
DATE=`date +"%Y-%m-%d_%H%M"`
SEPARATER=" "
exec < out_interfaces.cfg
while read source_path destination_path
do
 
cp $source_path destination_path
 
done

++++++++++++++++++++++++

out_interfaces.cfg file has below data

/usr/local1/file1 /usr/remote1
/usr/local2/file2 /usr/remote2
/usr/local3/file3 /usr/remote3

Thanks,

Qamar

Use "find" with the "-atime" option. A quick glance in the man page of find should provide you with all the wisdon you need.

I hope this helps.

bakunin

PS: you won't even need a script, it is a one-liner.