Created
February 17, 2015 17:06
-
-
Save SafPlusPlus/dc4200922bf7c3e9627f to your computer and use it in GitHub Desktop.
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/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