diff options
Diffstat (limited to 'upstream/mageia-cauldron/man5/crontab.5')
-rw-r--r-- | upstream/mageia-cauldron/man5/crontab.5 | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/upstream/mageia-cauldron/man5/crontab.5 b/upstream/mageia-cauldron/man5/crontab.5 index 5d898627..341c119b 100644 --- a/upstream/mageia-cauldron/man5/crontab.5 +++ b/upstream/mageia-cauldron/man5/crontab.5 @@ -98,7 +98,8 @@ This option is useful if you decide to use /bin/mail instead of aliasing and UUCP usually does not read its mail. If .I MAILFROM is defined (and non-empty), it is used as the envelope sender address, -otherwise, ``root'' is used. +otherwise, the username of the executing user is used. This variable is +also inherited from the crond process environment. .PP (Note: Both .I MAILFROM @@ -223,7 +224,10 @@ For example, "0-23/2" can be used in the 'hours' field to specify command execution for every other hour (the alternative in the V7 standard is "0,\:2,\:4,\:6,\:8,\:10,\:12,\:14,\:16,\:18,\:20,\:22"). Step values are also permitted after an asterisk, so if specifying a job to be run every -two hours, you can use "*/2". +two hours, you can use "*/2". Please note that steps are evaluated just +within the field they are applied to. For example "*/23" in hours field +means to execute the job on the hour 0 and the hour 23 within a calendar +day. See "NOTES" below for a workaround. .PP Names can also be used for the 'month' and 'day of week' fields. Use the first three letters of the particular day or month (case does not @@ -287,6 +291,20 @@ optional. MAILTO=root * * * * * root touch /tmp/file .fi +.SH NOTES +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; +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 +.fi +Adjust as needed if your +.BR date (1) +command does not accept "+%s" as the format string specifier to output +the current UNIX timestamp. .SH SELinux with multi level security (MLS) In a crontab, it is important to specify a security level by .I crontab \-s |