]> Frank Brehm's Git Trees - config/bruni/etc.git/commitdiff
saving uncommitted changes in /etc prior to emerge run
authorFrank Brehm <frank@brehm-online.com>
Wed, 23 May 2018 07:50:51 +0000 (09:50 +0200)
committerFrank Brehm <frank@brehm-online.com>
Wed, 23 May 2018 07:50:51 +0000 (09:50 +0200)
.etckeeper
anacrontab [new file with mode: 0644]
cron.d/0hourly [new file with mode: 0644]
cron.deny
cron.hourly/0anacron [new file with mode: 0755]
crontab
init.d/cronie

index c8a9c8c9f03a062cc8c8c2aca7c8e09b46ce60b7..17abaf67a32970306bfe9728ea51e9c5297e4913 100755 (executable)
@@ -150,6 +150,7 @@ maybe chmod 0644 'adobe/mms.cfg'
 maybe chmod 0600 'aiccu.conf'
 maybe chmod 0755 'alternatives'
 maybe chmod 0644 'alternatives/README'
+maybe chmod 0644 'anacrontab'
 maybe chmod 0755 'apache2'
 maybe chmod 0644 'apache2/httpd.conf'
 maybe chmod 0644 'apache2/magic'
@@ -1101,6 +1102,7 @@ maybe chgrp 'mail' 'courier/authlib/authsqliterc.dist'
 maybe chmod 0660 'courier/authlib/authsqliterc.dist'
 maybe chmod 0755 'cron.d'
 maybe chmod 0644 'cron.d/.keep_sys-process_cronie-0'
+maybe chmod 0644 'cron.d/0hourly'
 maybe chmod 0644 'cron.d/living'
 maybe chmod 0644 'cron.d/sysstat'
 maybe chmod 0750 'cron.daily'
@@ -1113,6 +1115,7 @@ maybe chmod 0755 'cron.daily/mlocate'
 maybe chmod 0644 'cron.deny'
 maybe chmod 0750 'cron.hourly'
 maybe chmod 0644 'cron.hourly/.keep_sys-process_cronbase-0'
+maybe chmod 0750 'cron.hourly/0anacron'
 maybe chmod 0750 'cron.monthly'
 maybe chmod 0644 'cron.monthly/.keep_sys-process_cronbase-0'
 maybe chmod 0750 'cron.weekly'
diff --git a/anacrontab b/anacrontab
new file mode 100644 (file)
index 0000000..78c6f8c
--- /dev/null
@@ -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
diff --git a/cron.d/0hourly b/cron.d/0hourly
new file mode 100644 (file)
index 0000000..1ab8c17
--- /dev/null
@@ -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
index 42cdd5f8c9a30a23a07c8f1172dbb131e8642216..f703d5846e41082520fa137c80014bd0abc27d8e 100644 (file)
--- a/cron.deny
+++ b/cron.deny
@@ -1,4 +1,3 @@
-# $Id$
 # If for any reason you have users in the 'cron' group who should not
 # be allowed to run crontab, add them to this file (one username per
 # line)
diff --git a/cron.hourly/0anacron b/cron.hourly/0anacron
new file mode 100755 (executable)
index 0000000..7bcb684
--- /dev/null
@@ -0,0 +1,17 @@
+#!/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
+
+# Do not run jobs when on battery power
+if test -x /usr/bin/on_ac_power; then
+    /usr/bin/on_ac_power >/dev/null 2>&1
+    if test $? -eq 1; then
+    exit 0
+    fi
+fi
+/usr/sbin/anacron -s
diff --git a/crontab b/crontab
index 14a6b9b1922f52806c63b93aa83d487f46f178e4..275f06c603d4feb824b5d0b0179f965cbe6484f9 100644 (file)
--- a/crontab
+++ b/crontab
@@ -1,15 +1,17 @@
-# for cronie
-# $Id$
-
 # Global variables
 SHELL=/bin/bash
 PATH=/sbin:/bin:/usr/sbin:/usr/bin
 MAILTO=root
 HOME=/
 
-# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
-59  *  * * *   root    rm -f /var/spool/cron/lastrun/cron.hourly
-9  3  * * *    root    rm -f /var/spool/cron/lastrun/cron.daily
-19 4  * * 6    root    rm -f /var/spool/cron/lastrun/cron.weekly
-29 5  1 * *    root    rm -f /var/spool/cron/lastrun/cron.monthly
-*/10  *  * * * root    test -x /usr/sbin/run-crons && /usr/sbin/run-crons
+# For details see man 4 crontabs
+
+# Example of job definition:
+# .---------------- minute (0 - 59)
+# |  .------------- hour (0 - 23)
+# |  |  .---------- day of month (1 - 31)
+# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
+# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
+# |  |  |  |  |
+# *  *  *  *  * user-name  command to be executed
+
index 781ff67c47f8f14f1b25d0603cd230ceda2cab7d..793e6213bfae33e528e8564d4fba2c1542ce5807 100755 (executable)
@@ -1,7 +1,6 @@
 #!/sbin/openrc-run
 # Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Id$
 
 command="/usr/sbin/crond"
 command_args="${CRONDARGS}"