1751974 Members
4586 Online
108784 Solutions
New Discussion

Re: Simple find command

 
SOLVED
Go to solution
Paul Sperry
Honored Contributor

Re: Simple find command

Ivan,

Yes I was using crontab -e to edit my cron jobs. But honestly any time I changed my job it quit working untill I restarted crond.
Makes no sence to me but I am glad to hear this isn't a "normal" thing to have to do.
Perhaps I am behind on patches. We are mostly a HP-UX and windows operation but are favoring Linux over Windows for any new servers.

Thanks again
Happy New Years To All


Paul
Muthukumar_5
Honored Contributor

Re: Simple find command

Try as,

#!/bin/sh

# Script
touch -t $(date +%m%d)0700 /tmp/reffile

# Will go to cron log
echo "Operation is Started :)"

for file in `find /usr/local/dumps -name "*.gz" -type f -newer /tmp/reffile`
do
cp ${file} /offsite_mnt;
done
sleep 1
rm -f /tmp/reffile

# Will go to cron log
echo "Operation is completed :)"

#END
exit 0

Edit crontab -e as,
5 * * * * path to script

and monitor cron log and post the result.

-Muthu
Easy to suggest when don't know about the problem!