Basically, all I want to do is copy files in a backup rotation. Here is the script:
cp /hd2/backups/cartoon5.tar /hd2/backups/cartoon6.tar
sleep 30
cp /hd2/backups/cartoon4.tar /hd2/backups/cartoon5.tar
sleep 30
cp /hd2/backups/cartoon3.tar /hd2/backups/cartoon4.tar
sleep 30
cp /hd2/backups/cartoon2.tar /hd2/backups/cartoon3.tar
sleep 30
cp /hd2/backups/cartoon1.tar /hd2/backups/cartoon2.tar
sleep 30
cp /hd2/backups/cartoon.tar /hd2/backups/cartoon1.tar
sleep 60
I get a copy, but an invisible one... when I ls -l, I see files like this:
cartoon6.tar?
cartoon5.tar?
cartoon4.tar?
cartoon3.tar?
cartoon2.tar?
What the heck am I doing wrong here? It CAN'T be that hard!
Oh- I am running this from CRON- does that make a difference?
Dave
You don't need cron if you do sleep(30), just make it run forever.
just assuming the cron job is scheduled daily here...
- if you run this script constantly you won't really have 6 generations of daily backups unless you sleep for 24 hours.
- you won't be consuming a process 24/7 if you use cron.
- if the process fails, you won't have cron to restart it on schedule.