mirror of
https://github.com/Ponce/slackbuilds
synced 2024-12-01 01:00:03 +01:00
24 lines
492 B
Text
24 lines
492 B
Text
|
#!/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"
|