Create a copy of the snapshot file

This commit is contained in:
Naglfar 2021-10-02 21:18:48 +02:00
parent c3467c105b
commit e756386ff0
1 changed files with 5 additions and 4 deletions

View File

@ -13,7 +13,7 @@ then
TYPE=incremental
else
TYPE=full
rm -f $BACKUPS/incremental.snapshot
rm -f $BACKUPS/*.snapshot
fi
tar -cz \
@ -36,16 +36,17 @@ tar -cz \
/var/lib/znc/configs/ /var/lib/znc/moddata/ \
/var/spool/cron/ \
/var/spool/anacron/ \
-g $BACKUPS/incremental.snapshot \
-g $BACKUPS/$TYPE.snapshot \
-f $BACKUPS/$DATE-$TYPE.tgz
chown root:sudo $BACKUPS/$DATE*.tgz
chmod 640 $BACKUPS/*.tgz
# Remove dumps and the previous backup once there is another.
if [ $TYPE = full ] && [ -e $LEVEL0 ]
if [ $TYPE = full ]
then
rm $LEVEL0 $BACKUPS/*incremental.tgz
cp $BACKUPS/full.snapshot $BACKUPS/incremental.snapshot
[ -e $LEVEL0 ] && rm $LEVEL0 $BACKUPS/*incremental.tgz
fi
# Database backup