mirror of
https://github.com/Mailu/Mailu.git
synced 2025-02-15 13:33:21 +02:00
Keep one more WAL archive, to enable single-last backup recovery
This commit is contained in:
parent
44dae7353c
commit
bdcf69b0e6
@ -17,14 +17,12 @@ done
|
||||
# Clean the wall archive
|
||||
cd /backup/wal_archive || exit $?
|
||||
if [ $(ls *.*.backup | wc -l) -lt 2 ]; then
|
||||
ls /backup/wal_archive
|
||||
exit 0
|
||||
fi
|
||||
# Find the single last wal.backup point
|
||||
prev_wal_start="$(ls *.*.backup | tail -n2 | head -n1)"
|
||||
prev_wal_start="$(ls *.*.backup | tail -n2 | head -n1 | cut -d '.' -f 1)"
|
||||
for f in $(ls) ; do
|
||||
if [ "$f" \< "$prev_wal_start" ] || [ "$f" \= "$prev_wal_start" ]; then
|
||||
if [ "$f" \< "$prev_wal_start" ]; then
|
||||
rm -v /backup/wal_archive/$f
|
||||
fi
|
||||
done
|
||||
ls /backup/wal_archive
|
||||
|
Loading…
x
Reference in New Issue
Block a user