Hi all,
Have the following snippet of code that I'm having trouble trying to work ...
The snippet of code is running on our Production Server and the intent is to copy the second most recent IDE file across from the Development Server.
I have the following files defined in $DEVLOC ...
-rw-r--r-- 1 root sys 245751 Aug 1 09:23 050729.14:20.ides.zip
-rw-r--r-- 1 root sys 245751 Aug 1 09:23 050729.14:32.ides.zip
-rw-r--r-- 1 root sys 245751 Aug 1 09:23 050729.15:18.ides.zip
-rw-r--r-- 1 root sys 245751 Aug 1 09:23 050729.15:28.ides.zip
-rw-r--r-- 1 root sys 247925 Aug 1 09:23 050730.00:05.ides.zip
-rw-r--r-- 1 root sys 249305 Aug 1 09:23 050731.00:05.ides.zip
-rw-r--r-- 1 root sys 253966 Aug 1 09:23 050801.00:06.ides.zip
-rw-r--r-- 1 root sys 121667 Aug 1 23:18 050802.00:05.ides.zip
-rw-r--r-- 1 root sys 128756 Aug 2 19:31 050803.00:05.ides.zip
-rw-r--r-- 1 root sys 131843 Aug 3 19:27 050804.00:05.ides.zip
-rw-r--r-- 1 root sys 137142 Aug 4 13:44 050805.00:05.ides.zip
-rw-r--r-- 1 root sys 143807 Aug 5 19:33 050806.00:05.ides.zip
-rw-r--r-- 1 root sys 146817 Aug 6 21:22 050807.00:05.ides.zip
-rw-r--r-- 1 root sys 146817 Aug 6 21:22 050808.00:05.ides.zip
-rw-r--r-- 1 root sys 150047 Aug 8 23:34 050809.00:05.ides.zip
-rw-r--r-- 1 root sys 155809 Aug 9 23:17 050810.00:05.ides.zip
I'm tried (in vain) initially to assign the most recent file, but business now requires second most recent (for QA reasoning).
I'm sure that I'm missing something really simple; just need a kick in the pants to have someone point it out for me; not having used `find` in scripts prior.
IDEtoFind=`find $DEVLOC -name \*.ides.zip -mtime -01 -print`
echo "Finding : $DEVLOC/$IDEtoFind" >>$templog
echo "Finding : $DEVLOC/$IDEtoFind"
echo "Copying : $DEVLOC/$IDEtoFind" >>$templog
echo " To : $tmp/$downloadfile" >>$templog
echo "Copying : $DEVLOC/$IDEtoFind"
echo " To : $tmp/$downloadfile"
cp $DEVLOC/$IDEtoFind $tmp/$downloadfile || error_copy
Any pointers would be of great assistance.