Skip to content

Instantly share code, notes, and snippets.

@xxdesmus
Created August 3, 2014 01:14
Show Gist options
  • Save xxdesmus/3b34ba0cbe1b60b4364a to your computer and use it in GitHub Desktop.
Save xxdesmus/3b34ba0cbe1b60b4364a to your computer and use it in GitHub Desktop.
tarsnap-delete.sh
#! /bin/bash
echo `date +%F\ %T`: Removing $1 backup from `date -d "7 days ago" "+%Y-%m-%d"` >> /var/log/tarsnap/backupscript.log
/usr/local/bin/tarsnap -d -f $1-`date -d "7 days ago" "+%Y-%m-%d"` &>> /var/log/tarsnap/backupscript.log
echo `date +%F\ %T`: Completed removing $1 backup from `date -d "7 days ago" "+%Y-%m-%d"` >> /var/log/tarsnap/backupscript.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment