Created
April 1, 2014 15:30
-
-
Save jclement/9916556 to your computer and use it in GitHub Desktop.
Really quick script to remove all but latest 60 backups with a given prefix from Tarsnap. Assumes archives have common prefix and a sortable suffix.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for f in `tarsnap --list-archives | grep "^ARCHIVE_PREFIX_HERE_" | sort -r | tail -n+60` | |
do | |
echo "Removing $f" | |
tarsnap -d -f $f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment