Mar 13, 2007 #1 snowsmart IS-IT--Management May 24, 2005 37 CA I need a script to list/copy all files ( which have been created in the last 2 hours) from one directory to another. it seems that the "find" command only can search by day not by hour. please help thanks
I need a script to list/copy all files ( which have been created in the last 2 hours) from one directory to another. it seems that the "find" command only can search by day not by hour. please help thanks
Mar 13, 2007 #2 sbrews Technical User Jun 11, 2003 413 US What version of "find" do you have? Gnu find supports an "amin" qualifier: -amin n File was last accessed n minutes ago. This looks like it will give you the results you want... if yo have or can get the gnu version. Upvote 0 Downvote
What version of "find" do you have? Gnu find supports an "amin" qualifier: -amin n File was last accessed n minutes ago. This looks like it will give you the results you want... if yo have or can get the gnu version.
Mar 14, 2007 #3 daFranze Technical User Dec 29, 2003 1,334 DE touch a reference file, which timnestamp is 2hr back and use find . -newer reffile -exec cp {} /dest/dir \; Best Regards, Franz -- System Manager (Solaris, HP-UX, Linux, some networking, some SAN) Upvote 0 Downvote
touch a reference file, which timnestamp is 2hr back and use find . -newer reffile -exec cp {} /dest/dir \; Best Regards, Franz -- System Manager (Solaris, HP-UX, Linux, some networking, some SAN)
Mar 15, 2007 Thread starter #4 snowsmart IS-IT--Management May 24, 2005 37 CA thanks ! Upvote 0 Downvote