summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdaily23
-rw-r--r--debian/changelog3
-rw-r--r--debian/cron.daily7
-rw-r--r--etckeeper.conf6
4 files changed, 22 insertions, 17 deletions
diff --git a/daily b/daily
index d35191a..f98c6ad 100755
--- a/daily
+++ b/daily
@@ -2,19 +2,16 @@
# Script that can be run daily to autocommit /etc changes.
set -e
if [ -x /usr/bin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; then
- . /etc/etckeeper/etckeeper.conf
- if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then
- # avoid autocommit if an install run is in progress
- lockfile=/var/cache/etckeeper/packagelist.pre-install
- if [ -e "$lockfile" ] && [ -n "$(find "$lockfile" -mtime +1)" ]; then
- rm -f "$lockfile" # stale
- fi
- if [ ! -e "$lockfile" ]; then
- AVOID_SPECIAL_FILE_WARNING=1
- export AVOID_SPECIAL_FILE_WARNING
- if etckeeper unclean; then
- etckeeper commit "daily autocommit" >/dev/null
- fi
+ # avoid autocommit if an install run is in progress
+ lockfile=/var/cache/etckeeper/packagelist.pre-install
+ if [ -e "$lockfile" ] && [ -n "$(find "$lockfile" -mtime +1)" ]; then
+ rm -f "$lockfile" # stale
+ fi
+ if [ ! -e "$lockfile" ]; then
+ AVOID_SPECIAL_FILE_WARNING=1
+ export AVOID_SPECIAL_FILE_WARNING
+ if etckeeper unclean; then
+ etckeeper commit "daily autocommit" >/dev/null
fi
fi
fi
diff --git a/debian/changelog b/debian/changelog
index 77c3b4a..aeaea9d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,9 @@ etckeeper (1.18.4) UNRELEASED; urgency=medium
Thanks, Tilman Blumenbach and Christian Hesse.
* Only run Pacman hooks when files in /etc have changed.
Thanks, Christian Hesse.
+ * Added systemd timer that can run etckeeper 10 minutes after boot, and also
+ daily. It's not enabled by default, partly because of overlap with the
+ cron job.
-- Joey Hess <id@joeyh.name> Mon, 29 Feb 2016 11:12:08 -0400
diff --git a/debian/cron.daily b/debian/cron.daily
index e00e570..eb74401 100644
--- a/debian/cron.daily
+++ b/debian/cron.daily
@@ -1,5 +1,8 @@
#!/bin/sh
set -e
-if [ -e /etc/etckeeper/daily ]; then
- /etc/etckeeper/daily
+if [ -e /etc/etckeeper/daily ] && [ -e /etc/etckeeper/etckeeper.conf ]; then
+ . /etc/etckeeper/etckeeper.conf
+ if [ "$AVOID_DAILY_AUTOCOMMITS" != "1" ]; then
+ /etc/etckeeper/daily
+ fi
fi
diff --git a/etckeeper.conf b/etckeeper.conf
index b17dc2b..0fb660b 100644
--- a/etckeeper.conf
+++ b/etckeeper.conf
@@ -16,8 +16,10 @@ BZR_COMMIT_OPTIONS=""
# Options passed to darcs record when run by etckeeper.
DARCS_COMMIT_OPTIONS="-a"
-# Uncomment to avoid etckeeper committing existing changes
-# to /etc automatically once per day.
+# Etckeeper includes both a cron job and a systemd timer, which each
+# can commit exiting changes to /etc automatically once per day.
+# To enable the systemd timer, run: systemctl enable etckeeper.timer
+# The cron job is enabled by default; to disable it, uncomment this next line.
#AVOID_DAILY_AUTOCOMMITS=1
# Uncomment the following to avoid special file warning