Skip to content

Commit 8d4a2c1

Browse files
authored
Block backup if current hour is after 8 AM
1 parent 2c05d7b commit 8d4a2c1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

bin/v-backup-user

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ is_backup_enabled
3939
# Action #
4040
#----------------------------------------------------------#
4141

42+
# block backup if current hour is after 8 AM
43+
if pgrep -x "v-backup-users" > /dev/null
44+
then
45+
hour=$(date +"%H");
46+
while [ "$hour" -gt "8" ]; do
47+
sleep 300
48+
done
49+
fi
50+
4251
# Set backup directory if undefined
4352
if [ -z "$BACKUP" ]; then
4453
BACKUP=/backup

0 commit comments

Comments
 (0)