#!/bin/bash
#
# Check Backup script
#
# Copyright Daniel Mehrmann (c) 2024
# Created 30.12.24
#

### check conditions

if [ -f /.backup_run ]; then
   echo "Lockfile from previous backup found!..."

   echo "$(basename "$0"): Lockfile found from previous backup run!" | mail Ssendwait -s "$(cat /etc/hostname) WARNING: make_backup.sh" root@localhost  
   echo -e '\a' > /dev/console
   sleep 2
   echo -e '\a' > /dev/console
   sleep 2
   echo -e '\a' > /dev/console

   echo "Start lvm_post_1_delete.sh..."
   ret=$(exec /usr/local/sbin/lvm_post_1_delete.sh)      
 
   exit "$ret" 
fi

exit 0
