Results 1 to 2 of 2
I do have a large number of cronjobs that I want to consolidate. The cronjobs are all calling the same script, but with a job specific tag. The jobs execute ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-24-2007 #1
- Join Date
- Oct 2007
cronjob - shell script related problem
I do have a large number of cronjobs that I want to consolidate. The cronjobs are all calling the same script, but with a job specific tag. The jobs execute an application backup job using a different configuration file. I have a total of 20 jobs and 20 different (pre-configured) configuration files. The jobs get executed in a 6 hour period one after another. Each job is a required pre-requisite for the next job to be successfully executed.
Somebody suggested that I should dump the commands into a shell script and then run a single cronjob against the shell script. Now I do not know how the shell script execution 'behaves' in regards to execution. Let's say I list my 20 crons one after another. How is that being executed? Does the script executes line 1 first and waits for the success message and then moves to line 2 and so on? Or what better way can I use to run my cronjobs? Here is an example of my jobs:
25 18 * * 5 /usr/local/v-backup/v-backup.pl -c /usr/local/v-backup/app-1-backup.cfg > /var/log/vbackup/app-1-backup.log
55 18 * * 5 /usr/local/v-backup/v-backup.pl -c /usr/local/v-backup/app-2-backup.cfg > /var/log/vbackup/app-2-backup.log
25 19 * * 5 /usr/local/v-backup/v-backup.pl -c /usr/local/v-backup/app-3-backup.cfg > /var/log/vbackup/app-3-backup.log
and so on ....
- 10-26-2007 #2
- Join Date
- Nov 2004
- Ft. Polk, LA
Shell scripts can run commands either. Just the command, like so:
/usr/bin/something --run-first && /usr/bin/something --run-second && /usr/bin/something --run-third