From: Christian Kastner <ckk@kvr.at>, Lance Lin <lq27267@gmail.com> Date: Thu, 28 Jul 2011 11:07:40 +0200 Subject: Manpage and typo fixes Last-Update: 21 Nov 2023 Correct some errors or clarify sections in the manpages; fix some typos --- man/cron.8 | 43 ++++++++++++++++--------------------------- man/crontab.1 | 2 +- man/crontab.5 | 2 +- src/cron.c | 2 +- 4 files changed, 19 insertions(+), 30 deletions(-) --- a/man/cron.8 +++ b/man/cron.8 @@ -37,23 +37,15 @@ .B -V .SH DESCRIPTION .I Cron -is started from -.I /etc/rc.d/init.d -or -.I /etc/init.d -when classical sysvinit scripts are used. In case systemd is enabled, then unit file is installed into -.I /lib/systemd/system/crond.service -and daemon is started by -.I systemctl start crond.service -command. It returns immediately, thus, there is no need to need to start it with -the '&' parameter. +is automatically started at boot time. .PP .I Cron searches .I /var/spool/cron -for crontab files which are named after accounts in -.I /etc/passwd; -The found crontabs are loaded into the memory. +for crontab files which are named after user accounts; +together with the system crontab +.IR /etc/crontab , +the found crontabs are loaded into the memory. .I Cron also searches for any files in the @@ -71,12 +63,11 @@ option. .PP There are two ways how changes in crontables are checked. The first -method is checking the modtime of a file. The second method is using the -inotify support. Using of inotify is logged in the -.I /var/log/cron -log after the daemon is started. The inotify support checks for changes -in all crontables and accesses the hard disk only when a change is -detected. +method is checking the modtime of a file. The second method +is using inotify support, which is only available on Linux. +When the daemon uses inotify, it logs this fact to syslog on startup. +The inotify support checks for changes in all crontables and accesses the +hard disk only when a change is detected. .PP When using the modtime option, .I Cron @@ -99,13 +90,8 @@ .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 -crontab. +command. .PP .SS Daylight Saving Time and other time changes Local time changes of less than three hours, such as those caused by the @@ -153,7 +139,6 @@ standard input and send it as a mail message to the recipients specified in the mail headers. Specifying the string .I "off" -(i.e., crond -m off) will disable the sending of mail. .TP .B "\-n" @@ -167,10 +152,14 @@ .B "\-f" the same as -n, consistent with other crond implementations. .TP +.B "\-i" +Disables inotify support (if present) +.TP .B "\-p" Allows .I Cron -to accept any user set crontables. +to accept any user set crontables (read: lift owner, type and mode +restrictions) .TP .B "\-P" Don't set PATH. PATH is instead inherited from the environment. --- a/man/crontab.1 +++ b/man/crontab.1 @@ -109,7 +109,7 @@ .IR /etc/cron.d/ directory. .PP -The temporary directory can be set in an environment variable. If it is +The temporary directory can be set using the environment variable $TMPDIR. If it is not set by the user, the .I /tmp directory is used. --- a/man/crontab.5 +++ b/man/crontab.5 @@ -65,7 +65,7 @@ .I LOGNAME and .I HOME -are set from the /etc/passwd line of the crontab\'s owner. +are set from the /etc/passwd line of the crontab's owner. .I HOME and .I SHELL @@ -272,7 +272,7 @@ # run at 2:15pm on the first of every month -- output mailed to paul 15 14 1 * * $HOME/bin/monthly # run at 10 pm on weekdays, annoy Joe -0 22 * * 1-5 mail -s "It's 10pm" joe%Joe,%%Where are your kids?% +0 22 * * 1-5 mail \-s "It's 10pm" joe%Joe,%%Where are your kids?% 23 0-23/2 * * * echo "run 23 minutes after midn, 2am, 4am ..., everyday" 5 4 * * sun echo "run at 5 after 4 every sunday" .fi @@ -292,14 +292,14 @@ * * * * * root touch /tmp/file .fi .SH NOTES -As noted above, skip values only operate within the time period they\'re +As noted above, skip values only operate within the time period they're attached to. For example, specifying "0/35" for the minute field of a -crontab entry won\'t cause that entry to be executed every 35 minutes; +crontab entry won't cause that entry to be executed every 35 minutes; instead, it will be executed twice every hour, at 0 and 35 minutes past. For more fine-grained control you can do something like this: .nf -* * * * * if [ $(expr \\( $(date +%s) / 60 \\) % 58) = 0 ]; then echo this runs every 58 minutes; fi -0 * * * * if [ $(expr \\( $(date +%s) / 3600 \\) % 23) = 0 ]; then echo this runs every 23 hours on the hour; fi +* * * * * if [ $(expr ( $(date +%s) / 60 ) % 58) = 0 ]; then echo this runs every 58 minutes; fi +0 * * * * if [ $(expr ( $(date +%s) / 3600 ) % 23) = 0 ]; then echo this runs every 23 hours on the hour; fi .fi Adjust as needed if your .BR date (1)