LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-12-2006, 08:39 PM   #1
wuqso
LQ Newbie
 
Registered: Dec 2004
Location: China
Distribution: FC5
Posts: 28

Rep: Reputation: 15
How can I change the default time of cron of the system?


Hi there, below is the content of my default 'crontab' file at /etc.


SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
40 4 1 * * root run-parts /etc/cron.monthly


So the default time of running crons (cron.daily, cron.weekly, etc) should be at 4 am. But, of course, my computer is shut down at that time. Then the crons usually run at about 9:20 am (I don't know why). I do not want that because I'm usually busy at that time. So I have changed all the '4' into '12' in the crontab file. Now I have the crons run at 12 am (12:02, 12:22, and 12:40 in fact) but the session at 9:20 am is not eliminated. So I have two sessions of crons every day...

Who can help me to eliminate the cron task at 9:20 am?
 
Old 06-12-2006, 09:43 PM   #2
slackhack
Senior Member
 
Registered: Jun 2004
Distribution: Arch, Debian, Slack
Posts: 1,016

Rep: Reputation: 47
i think in most cases you're supposed to use the crontab -e command to change cron, not edit the crontab file directly. but maybe there are different implementations of cron where you can just edit /etc/crontab, not sure. in any case, it might be helpful if you could post the output of crontab -l. i'm not seeing where the 9:20 is in what you posted.
 
Old 06-12-2006, 11:04 PM   #3
wuqso
LQ Newbie
 
Registered: Dec 2004
Location: China
Distribution: FC5
Posts: 28

Original Poster
Rep: Reputation: 15
Thanks for your answer, slackhack.

In fact, I have edited the crontab file directly. This approach works in at least FC3 but fails in my FC5 now. I do not know what's the reason for this result.

I input 'crontab -l' as root but got 'no crontab for root'. How can I get the output of crontab for the system?
 
Old 06-14-2006, 06:26 AM   #4
mekump
LQ Newbie
 
Registered: Feb 2006
Distribution: CentOS-4
Posts: 19

Rep: Reputation: 0
Hello,

You may want to check the man page for anacron.

Mike
 
Old 06-14-2006, 07:48 PM   #5
wuqso
LQ Newbie
 
Registered: Dec 2004
Location: China
Distribution: FC5
Posts: 28

Original Poster
Rep: Reputation: 15
Thank you, Mike. I checked the man page of anacron but did not find any useful information. Could you please put your idea in more detail?
 
Old 06-15-2006, 07:04 AM   #6
mekump
LQ Newbie
 
Registered: Feb 2006
Distribution: CentOS-4
Posts: 19

Rep: Reputation: 0
Hello,

I was just thinking that your job running at 0920 might be because of anacron. You may want to check the contents of your /etc/anacrontab. For example, if you power your pc up at 0900 and you have a line in the anacrontab file with a delay of 20 minutes, then the job on that line will run at 0920. You may also see something in the log file /var/log/cron that indicates this. If this is true, you can simply change the delay to suit you. If you need more info on anacrontab, check the man page. Let me know if this helps.

Mike
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron scheduling and time change dsschanze Linux - General 3 11-13-2005 04:22 PM
System time change loccom Linux - General 1 03-16-2005 09:58 AM
default system desktop ? how to change? hvinelinux Fedora 5 01-27-2005 02:27 PM
Cannot change system time mikemrh9 SUSE / openSUSE 7 01-02-2005 03:06 AM
how to change the default language of the system icoming Linux - General 8 06-01-2004 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:28 AM.

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