You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-11-29 22:37:58 +02:00
Keep one more WAL archive, to enable single-last backup recovery
This commit is contained in:
@@ -17,14 +17,12 @@ done
|
|||||||
# Clean the wall archive
|
# Clean the wall archive
|
||||||
cd /backup/wal_archive || exit $?
|
cd /backup/wal_archive || exit $?
|
||||||
if [ $(ls *.*.backup | wc -l) -lt 2 ]; then
|
if [ $(ls *.*.backup | wc -l) -lt 2 ]; then
|
||||||
ls /backup/wal_archive
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
# Find the single last wal.backup point
|
# 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
|
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
|
rm -v /backup/wal_archive/$f
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
ls /backup/wal_archive
|
|
||||||
|
|||||||
Reference in New Issue
Block a user