Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-24-2003, 11:14 AM   #1
Registered: Mar 2003
Posts: 123

Rep: Reputation: 15
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.
Old 07-24-2003, 12:50 PM   #2
Registered: Jul 2003
Distribution: Red Hat
Posts: 37

Rep: Reputation: 15
'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.
Old 07-24-2003, 02:36 PM   #3
Registered: Jul 2003
Location: San Diego, CA USA
Distribution: RH 7x,8x,9x, RHE 3, Fedora Core1
Posts: 38

Rep: Reputation: 15
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.

Old 08-01-2003, 10:13 AM   #4
LQ Newbie
Registered: Jul 2003
Location: India
Distribution: Red Hat 7.1
Posts: 27

Rep: Reputation: 15
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



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cron Job petenyce Linux - Newbie 5 10-11-2005 04:03 PM
need help with cron job parthcorp1 Linux - General 2 02-01-2005 11:37 AM
cron job? dr_zayus69 Linux - Newbie 14 12-01-2004 06:16 PM
cron job ? johnyy Linux - Software 3 12-10-2003 06:00 PM
cron job thesnaggle Linux - Newbie 1 09-19-2003 10:47 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:17 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration