Hello,
Before (fedora 10) the default file /etc/crontab was not empty. On my new fedora13 it is just almost empty. So I guess that the cron files are never run and there is probably a tool to manage it. Could you guide me ?
thank.
On Sat, 9 Oct 2010 18:37:27 +0100 (BST) Patrick Dupre wrote:
Before (fedora 10) the default file /etc/crontab was not empty. On my new fedora13 it is just almost empty. So I guess that the cron files are never run and there is probably a tool to manage it. Could you guide me ?
Everything is run by anacron these days (and I have to go to lots of trouble to disable it now). See /etc/anacrontab for the same sort of stuff that used to be in crontab (which will now be run at some randomly selected totally inconvenient time instead of on a reliable schedule).
On Sat, 9 Oct 2010, Tom Horsley wrote:
On Sat, 9 Oct 2010 18:37:27 +0100 (BST) Patrick Dupre wrote:
Before (fedora 10) the default file /etc/crontab was not empty. On my new fedora13 it is just almost empty. So I guess that the cron files are never run and there is probably a tool to manage it. Could you guide me ?
Everything is run by anacron these days (and I have to go to lots of trouble to disable it now). See /etc/anacrontab for the same sort of stuff that used to be in crontab (which will now be run at some randomly selected totally inconvenient time instead of on a reliable schedule).
OK But their is not anymore cron.daily by default ? Should it run by crontab ?
On Sat, 9 Oct 2010, Tom Horsley wrote:
On Sat, 9 Oct 2010 18:54:52 +0100 (BST) Patrick Dupre wrote:
But their is not anymore cron.daily by default ? Should it run by crontab ?
The cron.daily is still there, it is just being triggered by anacron now (by default).
Sorry, I wanted to say hourly !
On Sat, 9 Oct 2010 20:12:31 +0100 (BST) Patrick Dupre wrote:
The cron.daily is still there, it is just being triggered by anacron now (by default).
Sorry, I wanted to say hourly !
Hmmm... Not sure, doesn't look like it is there in the /etc/anacrontab anymore, but I think it is still being run by cron and has moved from /etc/crontab to /etc/cron.d/0hourly
On 10/09/2010 12:34 PM, Tom Horsley wrote:
On Sat, 9 Oct 2010 20:12:31 +0100 (BST) Patrick Dupre wrote:
The cron.daily is still there, it is just being triggered by anacron now (by default).
Sorry, I wanted to say hourly !
Hmmm... Not sure, doesn't look like it is there in the /etc/anacrontab anymore, but I think it is still being run by cron and has moved from /etc/crontab to /etc/cron.d/0hourly
Which is as it should be. Anacron is not for hourly because it doe snot assume the system is running continuously. Man page says:
ANACRON(8) Anacron Users’ Manual ANACRON(8)
NAME anacron - runs commands periodically
SYNOPSIS anacron [-s] [-f] [-n] [-d] [-q] [-t anacrontab] [-S spooldir] [job] anacron [-S spooldir] -u [-t anacrontab] [job] anacron [-V|-h] anacron -T [-t anacrontab]
DESCRIPTION Anacron is used to execute commands periodically, with a frequency specified in days. Unlike cron(8), it does not assume that the machine is running continuously. Hence, it can be used on machines that aren’t running 24 hours a day, to control regular jobs as daily, weekly, and monthly jobs.
On 10/09/2010 12:37 PM, Patrick Dupre wrote:
Hello,
Before (fedora 10) the default file /etc/crontab was not empty. On my new fedora13 it is just almost empty. So I guess that the cron files are never run and there is probably a tool to manage it. Could you guide me ?
thank.
Individual cron files are in /var/spool/cron
/etc/crontab doesn't do anything.
Check /etc/cron.hourly, cron.daily, etc.
[sdstern@sds-desk etc]$ ls -ld cron* drwxr-xr-x. 2 root root 4096 Aug 17 11:53 cron.d drwxr-xr-x. 2 root root 4096 Sep 27 07:56 cron.daily -rw-r--r--. 1 root root 0 Aug 13 08:53 cron.deny drwxr-xr-x. 2 root root 4096 Aug 17 11:53 cron.hourly drwxr-xr-x. 2 root root 4096 Jun 12 11:03 cron.monthly -rw-r--r--. 1 root root 448 Oct 12 2009 crontab drwxr-xr-x. 2 root root 4096 Oct 12 2009 cron.weekly
to edit an individual account, su to that account and use crontab -e.
On 10/09/2010 03:25 PM, Steven Stern wrote:
On 10/09/2010 12:37 PM, Patrick Dupre wrote:
Before (fedora 10) the default file /etc/crontab was not empty. On my new fedora13 it is just almost empty. So I guess that the cron files are never run and there is probably a tool to manage it. Could you guide me ?
Individual cron files are in /var/spool/cron
/etc/crontab doesn't do anything.
Then why is it still there, leading one to think they can edit it for global cron jobs?
Shouldn't it have some text in it like:
# This file is now dead. It is only here for historical purposes. # Either use anacron or user crontabs.
Or some such?
I am getting ready to FINALLY really do something with cron, and I wanted to use /etc/crontab rather than root's crontab. And reading docs, some refer to a line needed in this file as the user that the command runs under, yet the comments in the file do not include a user field. That got me back to this list, and before asking, I did a search and found this thread. One frustrating thing is that if you use "crontab -e" you have no direct guidance as to the fields (no comment lines put there by default).
Also is EMAIL by default to the user (in my case root) unless you have "MAILTO=" ?
On Thu, 18 Nov 2010 09:35:16 -0500 Robert Moskowitz wrote:
Then why is it still there, leading one to think they can edit it for global cron jobs?
You can edit it for global cron jobs (or you can drop files in the /etc/cron.d/ directory). In fact I do edit it: I move everything out of the /etc/anacrontab file and back into /etc/crontab where it will run at a known time rather than a random time (or course, I have to change the syntax and say what time I want it to run).
On 11/18/2010 09:49 AM, Tom Horsley wrote:
On Thu, 18 Nov 2010 09:35:16 -0500 Robert Moskowitz wrote:
Then why is it still there, leading one to think they can edit it for global cron jobs?
You can edit it for global cron jobs (or you can drop files in the /etc/cron.d/ directory). In fact I do edit it: I move everything out of the /etc/anacrontab file and back into /etc/crontab where it will run at a known time rather than a random time (or course, I have to change the syntax and say what time I want it to run).
OK. But what about: http://mailman.linuxchix.org/pipermail/courses/2004-February/001389.html which is old, but says that there is a user field in the /etc/crontab version? Is there?
On Thu, 18 Nov 2010 10:05:08 -0500 Robert Moskowitz wrote:
OK. But what about: http://mailman.linuxchix.org/pipermail/courses/2004-February/001389.html which is old, but says that there is a user field in the /etc/crontab version? Is there?
The crontab(5) man page says there is (if you read it 5 or six times to decrypt the convoluted description :-). My /etc/crontab file certainly seems to have a user field:
01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly
On 11/18/2010 10:30 AM, Tom Horsley wrote:
On Thu, 18 Nov 2010 10:05:08 -0500 Robert Moskowitz wrote:
OK. But what about: http://mailman.linuxchix.org/pipermail/courses/2004-February/001389.html which is old, but says that there is a user field in the /etc/crontab version? Is there?
The crontab(5) man page says there is (if you read it 5 or six times to decrypt the convoluted description :-).
Us dyslexics have to read it 7-9 times! Thanks.
My /etc/crontab file certainly seems to have a user field:
01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly
I am just observing the comments in the file:
# Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * command to be executed
No user field specifed...
Well I will remove the /var/spool/cron/root file and go with the /etc/crontab, as it is easier to document what you have customized on a system this way (IMNSHO).
On Thu, 18 Nov 2010 10:58:14 -0500, Robert wrote:
My /etc/crontab file certainly seems to have a user field:
01 * * * * root run-parts /etc/cron.hourly 02 4 * * * root run-parts /etc/cron.daily 22 4 * * 0 root run-parts /etc/cron.weekly 42 4 1 * * root run-parts /etc/cron.monthly
I am just observing the comments in the file:
# Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * command to be executed
No user field specifed...
That's because the documentation in /etc/crontab is wrong. I've pointed that out in a recent crontabs package update ticket, but haven't filed a separate bug report about it due to lack of time.