#!/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
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
+# Run the hourly jobs
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
+# 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
.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
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
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)