Editing a cron job
I'm running RedHat 7.3 and have a backup job that is scheduled to run every night. I think the window is too small for the entire job to complete, so I'd like to kick it off earlier. I didn't write the script, and I'm not sure where to find the actual cron file that tells it what time to kick off....Can anyone help? Thanks.
|
'cron -e' usually does the trick. It will open your "default" text editor (usually vi or pico) so that you can edit your cron jobs.
|
all cronjob times or schedules will begin with /etc/crontab. This file is editable with any standard text editor.
This a pretty well writen doc on crontab and scheduling. http://www.wam.umd.edu/~kghose/Personal/linuxhowto.html Ed |
about editing a cron job
Doing a backup job in the night is usually done by writing a small shell script .. i used to do that , anyway i donot know what procedure you are going to follow , anyway you need to have a script atleast if you are not trying to do it through system calls, anyway abt firing that script you need to write a cron , when you are logged into ur login , issue crontab -e .. this will open a file looking very much like a file in vi editor ... write
0 22 * * * /path/to/your/script_of_backup this means the backup script will run every day , every week , every month at exactly 22:hrs in the night .... Be careful with crontab -r .. it deletes without a warning abt some informal discussion ... the general syntax of writing this : (minutes) (hrs) (day_of_month) (month) (day_of_week) which takes inputs in the form (0-59) (0-23) (1-31) (1-12) (0-6) respectively Thus : 0 1 * * 1-5 command (will run every monday-friday at 1 am) 0 1 * * 1,3,5 command (will run every mon,wed,fri at 1 am) 10 2 1 * * command (will run at 2:10 am on the first of every month) 0 1 1 1 * command (will run at 1 am on January 1 every year) Just pure calculation nothing else .. do let me know if it works Best of luck Shaheen |
All times are GMT -5. The time now is 03:30 PM. |