From 988861d8dca420f5c8b1663721869b99f04eacf8 Mon Sep 17 00:00:00 2001 From: Sean Donner Date: Tue, 11 May 2010 20:01:09 +0200 Subject: misc/rsnapshot: Added to 12.0 repository --- misc/rsnapshot/contrib/rsnapshot_weekly | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 misc/rsnapshot/contrib/rsnapshot_weekly (limited to 'misc/rsnapshot/contrib/rsnapshot_weekly') diff --git a/misc/rsnapshot/contrib/rsnapshot_weekly b/misc/rsnapshot/contrib/rsnapshot_weekly new file mode 100644 index 0000000000..bcdb797e3c --- /dev/null +++ b/misc/rsnapshot/contrib/rsnapshot_weekly @@ -0,0 +1,23 @@ +#!/bin/bash + +INTERVAL="weekly" +RSNAPSHOT="/usr/bin/rsnapshot" +MOUNTPOINT="/backup" +LOGFILE="/var/log/rsnapshot" +PIDFILE="/var/run/rsnapshot.pid" + +# Check to make sure rsnapshot isn't currently running + +if [[ -f "$PIDFILE" ]]; then + echo "$PIDFILE already exists, skipping "$INTERVAL" run" >> "$LOGFILE" + exit +fi + +# remount filesystem read/write +mount -o remount,rw "$MOUNTPOINT" + +# call rsnapshot +"$RSNAPSHOT" "$INTERVAL" + +# remount filesystem read-only +mount -o remount,ro "$MOUNTPOINT" -- cgit v1.2.3