From: Tomas Mraz Date: Wed, 7 Dec 2011 12:19:57 +0000 (+0100) Subject: Adjust the documentation to better describe the current situation with crontab and... X-Git-Tag: cronie1.4.9~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=134c025a7cefe3d8f18b150129d42c764dbcb783;p=cronie Adjust the documentation to better describe the current situation with crontab and anacrontab. --- diff --git a/contrib/0anacron b/contrib/0anacron index 6835088..16fd10a 100644 --- a/contrib/0anacron +++ b/contrib/0anacron @@ -1,5 +1,5 @@ #!/bin/bash -#in case file doesn't exist +# Check whether 0anacron was run today already if test -r /var/spool/anacron/cron.daily; then day=`cat /var/spool/anacron/cron.daily` fi @@ -7,8 +7,7 @@ if [ `date +%Y%m%d` = "$day" ]; then exit 0; fi -# in case anacron is already running, -# there will be log (daemon won't be running twice). +# Do not run jobs when on battery power if test -x /usr/bin/on_ac_power; then /usr/bin/on_ac_power &> /dev/null if test $? -eq 1; then diff --git a/contrib/0hourly b/contrib/0hourly index 09039c1..1ab8c17 100644 --- a/contrib/0hourly +++ b/contrib/0hourly @@ -1,3 +1,4 @@ +# Run the hourly jobs SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root diff --git a/contrib/dailyjobs b/contrib/dailyjobs index ee9af24..5e68fb5 100644 --- a/contrib/dailyjobs +++ b/contrib/dailyjobs @@ -1,3 +1,4 @@ +# Run the daily, weekly, and monthly jobs if cronie-anacron is not installed SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root diff --git a/man/cron.8 b/man/cron.8 index 8f36a51..d378927 100644 --- a/man/cron.8 +++ b/man/cron.8 @@ -82,17 +82,23 @@ crontables were modified. The modtime option is also used when inotify can not b .PP .I Cron checks these files and directories: +.TP +.IR /etc/crontab +system crontab. Nowadays the file is empty by default. Originally it was usually used to run daily, weekly, +monthly jobs. By default these jobs are now run through anacron which reads .IR /etc/anacrontab -system crontab, usually used to run daily, weekly, monthly jobs. See +configuration file. See .BR anacrontab (5) for more details. +.TP .IR /etc/cron.d/ directory that contains system cronjobs stored for different users. +.TP .IR /var/spool/cron directory that contains user crontables created by the .IR crontab command. - +.PP Note that the .BR crontab (1) command updates the modtime of the spool directory whenever it changes a diff --git a/man/crontab.5 b/man/crontab.5 index 0132fc7..d15334e 100644 --- a/man/crontab.5 +++ b/man/crontab.5 @@ -245,7 +245,7 @@ The jobs in and .I /etc/crontab are system jobs, which are used usually for more than -one user, thus, the username is needed. MAILTO on the first line +one user, thus, additionaly the username is needed. MAILTO on the first line is optional. .SH EXAMPLE OF A JOB IN /etc/cron.d/job .nf @@ -274,12 +274,12 @@ MLS_LEVEL=SystemHigh 0-59 * * * * id -Z > /tmp/SystemHigh/crontest .fi .SH FILES -.I /etc/anacrontab -system crontab file for jobs like cron.daily, weekly, monthly. +.I /etc/crontab +main system crontab file. .I /var/spool/cron/ a directory for storing crontabs defined by users. .I /etc/cron.d/ -a directory for storing system crontables. +a directory for storing system crontabs. .SH "SEE ALSO" .BR cron (8), .BR crontab (1)