Block backup if current hour is after 8 AM

This commit is contained in:
myvesta 2018-09-02 02:07:19 +02:00 committed by GitHub
commit 8d4a2c1707
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -39,6 +39,15 @@ is_backup_enabled
# Action # # Action #
#----------------------------------------------------------# #----------------------------------------------------------#
# block backup if current hour is after 8 AM
if pgrep -x "v-backup-users" > /dev/null
then
hour=$(date +"%H");
while [ "$hour" -gt "8" ]; do
sleep 300
done
fi
# Set backup directory if undefined # Set backup directory if undefined
if [ -z "$BACKUP" ]; then if [ -z "$BACKUP" ]; then
BACKUP=/backup BACKUP=/backup