Welcome to WebmasterWorld Guest from 54.196.238.210

Forum Moderators: phranque

Message Too Old, No Replies

Cron Job Not Working

Probably Easy Solutin (I hope!)

     

carfac

2:51 pm on Dec 12, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi:

I have a simple cron job for rotating backup files. It is run by a script. I see it running, but it is not actually rotating the files. Probably something stupid I am missing, like a flag to the copy "cp" command, but I do not know what it is. Anybody want to look at my script and see what they think?

Script:

cp /hd2/backups/#*$!3.tar /hd2/backups/#*$!4.tar
sleep 30
cp /hd2/backups/#*$!2.tar /hd2/backups/#*$!3.tar
sleep 30
cp /hd2/backups/#*$!1.tar /hd2/backups/#*$!2.tar
sleep 30
cp /hd2/backups/#*$!.tar /hd2/backups/#*$!1.tar
sleep 150

(the script repeats with various other files, but this is the basic format)

Thanks!

Dave

RonPK

1:54 pm on Dec 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Some thoughts:
Does the command work if you run it from the command line?
Does the cron user have the necessary permissions to overwrite existing files?
What is the output of
cp -v /hd2/backups/#*$!.tar /hd2/backups/#*$!1.tar
(-v for being verbose)?
 

Featured Threads

Hot Threads This Week

Hot Threads This Month