Import Upstream version 1.7.2
This commit is contained in:
34
contrib/0anacron
Normal file
34
contrib/0anacron
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
# Check whether 0anacron was run today already
|
||||
if test -r /var/spool/anacron/cron.daily; then
|
||||
day=`cat /var/spool/anacron/cron.daily`
|
||||
fi
|
||||
if [ `date +%Y%m%d` = "$day" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Check whether run on battery should be allowed
|
||||
if test -r /etc/default/anacron; then
|
||||
. /etc/default/anacron
|
||||
fi
|
||||
|
||||
if [ "$ANACRON_RUN_ON_BATTERY_POWER" != "yes" ]; then
|
||||
|
||||
# Do not run jobs when on battery power
|
||||
online=1
|
||||
for psupply in /sys/class/power_supply/* ; do
|
||||
if [ `cat "$psupply/type" 2>/dev/null`x = Mainsx ] && [ -f "$psupply/online" ]; then
|
||||
if [ `cat "$psupply/online" 2>/dev/null`x = 1x ]; then
|
||||
online=1
|
||||
break
|
||||
else
|
||||
online=0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if [ $online = 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
fi
|
||||
/usr/sbin/anacron -s
|
||||
5
contrib/0hourly
Normal file
5
contrib/0hourly
Normal file
@@ -0,0 +1,5 @@
|
||||
# Run the hourly jobs
|
||||
SHELL=/bin/bash
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
MAILTO=root
|
||||
01 * * * * root run-parts /etc/cron.hourly
|
||||
16
contrib/anacrontab
Normal file
16
contrib/anacrontab
Normal file
@@ -0,0 +1,16 @@
|
||||
# /etc/anacrontab: configuration file for anacron
|
||||
|
||||
# See anacron(8) and anacrontab(5) for details.
|
||||
|
||||
SHELL=/bin/sh
|
||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
MAILTO=root
|
||||
# the maximal random delay added to the base delay of the jobs
|
||||
RANDOM_DELAY=45
|
||||
# the jobs will be started during the following hours only
|
||||
START_HOURS_RANGE=3-22
|
||||
|
||||
#period in days delay in minutes job-identifier command
|
||||
1 5 cron.daily nice run-parts /etc/cron.daily
|
||||
7 25 cron.weekly nice run-parts /etc/cron.weekly
|
||||
@monthly 45 cron.monthly nice run-parts /etc/cron.monthly
|
||||
15
contrib/cronie.systemd
Normal file
15
contrib/cronie.systemd
Normal file
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Command Scheduler
|
||||
After=auditd.service nss-user-lookup.target systemd-user-sessions.service time-sync.target ypbind.service autofs.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/etc/sysconfig/crond
|
||||
ExecStart=/usr/sbin/crond -n $CRONDARGS
|
||||
ExecReload=/bin/kill -URG $MAINPID
|
||||
KillMode=process
|
||||
Restart=on-failure
|
||||
RestartSec=30s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
9
contrib/dailyjobs
Normal file
9
contrib/dailyjobs
Normal file
@@ -0,0 +1,9 @@
|
||||
# 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
|
||||
|
||||
# run-parts
|
||||
02 4 * * * root [ ! -f /etc/cron.hourly/0anacron ] && run-parts /etc/cron.daily
|
||||
22 4 * * 0 root [ ! -f /etc/cron.hourly/0anacron ] && run-parts /etc/cron.weekly
|
||||
42 4 1 * * root [ ! -f /etc/cron.hourly/0anacron ] && run-parts /etc/cron.monthly
|
||||
Reference in New Issue
Block a user