-
Notifications
You must be signed in to change notification settings - Fork 0
Backup retention #2
Copy link
Copy link
Open
Labels
Milestone
Description
Enable/specify the # of backups to be retained, ala
how many backups to keep
KEEP_BACKUPS=7
backups_count=
ls -1 $BACKUP_DIR | wc -l
backups_to_remove=$(($backups_count-$KEEP_BACKUPS))
if [ $backups_to_remove -gt 0 ]; then
for d inls -1 $BACKUP_DIR | head -n$backups_to_remove; do
docmd "rm -rf $BACKUP_DIR/$d"
done
fi
More info:
https://gist.github.com/morhekil/8382294
Reactions are currently unavailable