Skip to content

Instantly share code, notes, and snippets.

@jgosmann
Created April 8, 2014 15:41
Show Gist options
  • Select an option

  • Save jgosmann/10145059 to your computer and use it in GitHub Desktop.

Select an option

Save jgosmann/10145059 to your computer and use it in GitHub Desktop.
#!/bin/sh
if test -n "$(find /mnt/backup/last_daily -mtime 1)"; then
echo 'Daily backup.'
/usr/bin/rsnapshot daily
date > /root/backup_w/last_daily
fi
if test -n "$(find /mnt/backup/last_weekly -mtime 7)"; then
echo 'Weekly backup.'
/usr/bin/rsnapshot weekly
date > /root/backup_w/last_weekly
fi
if test -n "$(find /mnt/backup/last_monthly -mtime 30)"; then
echo 'Monthly backup.'
/usr/bin/rsnapshot monthly
date > /root/backup_w/last_monthly
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment