The repo I use to run gitea and caddy all in docker
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

15 lines
412 B

#!/usr/bin/env bash
CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
BACKUP_DIR="$CURRENT_DIR/backups"
##
# Verify there is at least 5 backups
BACKUPS=$(/usr/bin/find "$BACKUP_DIR" -name "*.zip" -print | wc -l)
if (( BACKUPS < 5 )); then
echo "There is less than five backups so we won't prune!"
exit 1
fi
/usr/bin/find "$BACKUP_DIR" -mtime +5 -name "gitea-dump-*.zip" -exec /bin/rm '{}' \;