Commit cc06d090 authored by kaiyou's avatar kaiyou
Browse files

Properly remove old wal files

parent 7fb29249
......@@ -9,5 +9,5 @@ cd $PROJECTDIR
rm -rf $(find $BASEDIR/wal -mindepth 1 -type d)
docker-compose exec $SERVICE pg_basebackup -D /wal/$(date +%s) -F t -z -P -U $USER
current=$(ls $BASEDIR/wal | grep 'backup$' | tail -n 1)
find $BASEDIR/wal -type f ! -newer $current ! -name $current -exec rm {} \;
find $BASEDIR/wal -type f ! -newer $BASEDIR/wal/$current ! -name $current -exec rm {} \;
ls -lah $BASEDIR/wal
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment