Skip to content

Instantly share code, notes, and snippets.

@SafPlusPlus
Created February 17, 2015 17:06
Show Gist options
  • Save SafPlusPlus/dc4200922bf7c3e9627f to your computer and use it in GitHub Desktop.
Save SafPlusPlus/dc4200922bf7c3e9627f to your computer and use it in GitHub Desktop.
#!/bin/bash
# author: [email protected]
echo "###### Starting at `date '+%Y-%m-%m %H:%M:%S'` ######"
echo "Thining out quarter hourly backups to hourly backups..."
# delete non-hourly backups older than 3 days
find /opt/backup/minecraft/instances/tk_prod -maxdepth 2 -ctime +2 -type d -path '/opt/backup/minecraft/instances/tk_prod/????-??-??/??.??' -not -name '??.00' -exec echo "Going to delete {}" \; -exec rm -rf {} \;
echo "Thining out hourly backups to daily backups..."
# delete non 00:00 backups older than 7 days
find /opt/backup/minecraft/instances/tk_prod -maxdepth 2 -ctime +7 -type d -path '/opt/backup/minecraft/instances/tk_prod/????-??-??/??.??' -not -name '00.00' -exec echo "Going to delete {}" \; -exec rm -rf {} \;
echo "###### Finished at `date '+%Y-%m-%m %H:%M:%S'` ######"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment