Update backup script to start a new backup, but replace the old-typofix

This commit is contained in:
Eric Renfro 2024-08-02 15:55:36 -04:00
parent 44820bdd75
commit 654bc34204
Signed by: psi-jack
SSH key fingerprint: SHA256:1TKB8Z257L8EHK8GWNxKgMhD8a+FAR+f+j3nnlcuNVM

View file

@ -23,10 +23,10 @@ if [[ "$?" -ne 0 ]]; then
echo "ERROR: Backup failure"
exit 1
else
if [[ -f "/var/backup/$bhost-stage4.zst" ]]; then
rm -f "/var/backup/$bhost-stage4.zst"
if [[ -f "/var/backup/$bhost-stage4.tar.zst" ]]; then
rm -f "/var/backup/$bhost-stage4.tar.zst"
fi
mv "/var/backup/$bhost-stage4-$bdate.zst" "/var/backup/$bhost-stage4.zst"
mv "/var/backup/$bhost-stage4-$bdate.tar.zst" "/var/backup/$bhost-stage4.tar.zst"
fi
popd &>/dev/null || exit 2