File: daily

package info (click to toggle)
etckeeper 1.18.23-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,640 kB
  • sloc: sh: 1,267; python: 111; makefile: 109; ansic: 81
file content (17 lines) | stat: -rwxr-xr-x 551 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
# Script that can be run daily to autocommit /etc changes.
set -e
if [ -x /usr/bin/etckeeper ] && [ -e /etc/etckeeper/etckeeper.conf ]; 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
	fi
fi