Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Mehani <shtrom@ssji.net>2020-03-23 13:31:18 +0100
committerOlivier Mehani <shtrom@ssji.net>2020-07-03 07:42:12 +0200
commit036cab76202aeea3b7ae841583c8bb2d48eb8b43 (patch)
tree91249a4be24fa52e5fec10c7166e1add85865ee9
parent29f020c030d797b72e7d57f42dc15c5476539a6d (diff)
[titanium-cleanup] report count of cleared files
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
-rwxr-xr-xopenbsd/backup-cleanup.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/openbsd/backup-cleanup.sh b/openbsd/backup-cleanup.sh
new file mode 100755
index 0000000..7212c0e
--- /dev/null
+++ b/openbsd/backup-cleanup.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+BACKUPCLEANUPHORIZON="${1:-6M}"
+
+# The following variables can be overridden in /etc/backup.sh.conf
+DIRS="/etc /srv"
+TMPSUBDIR=/tmp
+
+BACKUPROOT="/srv/rdiff-backup"
+BACKUPDIR="${BACKUPROOT}/`hostname -s`"
+BACKUPSERVER=backup.example.net
+EXCLUDEALWAYS="${BACKUPROOT}"
+
+test -e /etc/backup.sh.conf && . /etc/backup.sh.conf
+
+for dir in ${DIRS}; do
+ rdiff-backup -v 6 --remove-older-than ${BACKUPCLEANUPHORIZON} --force ${BACKUPDIR}$dir
+done
+