Fix looking for the wrong kinda backups in dokuwiki backup script

This commit is contained in:
Salt 2020-05-06 09:43:12 -05:00
parent 7646396dac
commit c3fa85aacb

View File

@ -27,7 +27,7 @@ fi
# Purge oldest backup if we need to
currentbackupcount="$(ls -1 "$OUTDIR" | wc -l)"
if (( currentbackupcount >= retention )); then
lastbackup="$(find "$OUTDIR" -name \*.zip 2>/dev/null | sort | head -n 1)"
lastbackup="$(find "$OUTDIR" -name \*.tar.gz 2>/dev/null | sort | head -n 1)"
if [ -f "$lastbackup" ]; then
log "Removing old backup: $lastbackup"
rm "$lastbackup"