Add a simple script for running rsync_tmbackup.sh from cron.

This commit is contained in:
Robert Bruce Park
2013-11-23 01:07:31 -08:00
parent f5a4275a04
commit 392b8089a5
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
#
# Installation instructions:
#
# 1. Declare where you installed rsync_tmbackup.sh to:
TMBACKUP="/usr/local/bin/rsync_tmbackup.sh"
# 2. Copy this script to /etc/cron.hourly
#
# 3. Run `sudo chmod 755 /etc/cron.hourly/cron_hourly_backup.sh`
#
# Ubuntu Fedora
for DEST in /media/*/*/ /run/media/*/*/; do
[ -f "$DEST/backup.marker" ] || continue
USERNAME=$(basename $(dirname "$DEST"))
EXCLUDES=$(find /home/$USERNAME/.backup.excludes 2>/dev/null)
bash $TMBACKUP /home/$USERNAME $DEST $EXCLUDES
done