summaryrefslogtreecommitdiffstats
path: root/misc/rsnapshot/contrib/rsnapshot_hourly
diff options
context:
space:
mode:
author Sean Donner <sean.donner@sbcglobal.net>2010-05-11 20:01:09 +0200
committer Robby Workman <rworkman@slackbuilds.org>2010-05-11 20:01:09 +0200
commit988861d8dca420f5c8b1663721869b99f04eacf8 (patch)
tree70b134924d7d5f46fd169f4393430d5e9d9a4ae9 /misc/rsnapshot/contrib/rsnapshot_hourly
parentc25ac953ad4870cd2ac187ce1e5ff8e4083d3c33 (diff)
downloadslackbuilds-988861d8dca420f5c8b1663721869b99f04eacf8.tar.gz
slackbuilds-988861d8dca420f5c8b1663721869b99f04eacf8.tar.xz
misc/rsnapshot: Added to 12.0 repository
Diffstat (limited to 'misc/rsnapshot/contrib/rsnapshot_hourly')
-rw-r--r--misc/rsnapshot/contrib/rsnapshot_hourly23
1 files changed, 23 insertions, 0 deletions
diff --git a/misc/rsnapshot/contrib/rsnapshot_hourly b/misc/rsnapshot/contrib/rsnapshot_hourly
new file mode 100644
index 0000000000..3fcbf68bca
--- /dev/null
+++ b/misc/rsnapshot/contrib/rsnapshot_hourly
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+INTERVAL="hourly"
+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"