adding backupdir variable to db rotate

This commit is contained in:
simon 2021-05-15 21:47:08 +07:00
parent 497d530f64
commit 32a74c611c
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ backup_dir="$HOME/backup"
docker exec postgres pg_dump -U aqi | gzip > "$backup_dir/pg_$time_stamp.gz"
# rotate
find backup/ -type f -name "pg_*.gz" | sort -r | tail -n +15 | xargs --no-run-if-empty trash
find "$backup_dir" -type f -name "pg_*.gz" | sort -r | tail -n +15 | xargs --no-run-if-empty trash
# log
log_file="$backup_dir/pg_status.log"