File tree 6 files changed +24
-11
lines changed
6 files changed +24
-11
lines changed Original file line number Diff line number Diff line change @@ -39,11 +39,15 @@ You can find it here: run 'sudo bash $SCRIPTS/menu.sh' -> choose 'Server Configu
39
39
then
40
40
exit 1
41
41
fi
42
+ rm -f /tmp/DAILY_BACKUP_CREATION_SUCCESSFUL
42
43
export SKIP_DAILY_BACKUP_CHECK=1
43
44
bash " $DAILY_BACKUP_FILE "
44
- if ! yesno_box_no " Was the backup successfully? If yes, we will start with the database shrinking now. "
45
+ if ! [ -f " /tmp/DAILY_BACKUP_CREATION_SUCCESSFUL " ]
45
46
then
46
- exit 1
47
+ if ! yesno_box_no " It seems like the backup was not successful. Do you want to continue nonetheless? (Not recommended!)"
48
+ then
49
+ exit 1
50
+ fi
47
51
fi
48
52
fi
49
53
Original file line number Diff line number Diff line change @@ -100,9 +100,10 @@ then
100
100
# Create backup first
101
101
if [ -f " $SCRIPTS /daily-borg-backup.sh" ] && does_snapshot_exist " NcVM-snapshot"
102
102
then
103
+ rm -f /tmp/DAILY_BACKUP_CREATION_SUCCESSFUL
103
104
export SKIP_DAILY_BACKUP_CHECK=1
104
105
bash " $SCRIPTS /daily-borg-backup.sh"
105
- if [ -z " $ DAILY_BACKUP_CREATION_SUCCESSFUL" ]
106
+ if ! [ -f " /tmp/ DAILY_BACKUP_CREATION_SUCCESSFUL" ]
106
107
then
107
108
notify_admin_gui " Update failed because backup could not be created!" \
108
109
" Could not create a backup! $( date +%T) "
Original file line number Diff line number Diff line change @@ -584,8 +584,9 @@ Please don't restart or shutdown your server until then!"
584
584
remove_log_file
585
585
fi
586
586
587
- # Export a variable that can be checked for
588
- export DAILY_BACKUP_CREATION_SUCCESSFUL=1
587
+ # Create a file that can be checked for
588
+ rm -f /tmp/DAILY_BACKUP_CREATION_SUCCESSFUL
589
+ touch /tmp/DAILY_BACKUP_CREATION_SUCCESSFUL
589
590
590
591
# Exit here if the backup doesn't shall get checked
591
592
if [ -z " $CHECK_BACKUP " ]
705
706
remove_log_file
706
707
fi
707
708
708
- # Export a variable that can be checked for
709
- export DAILY_BACKUP_CHECK_SUCCESSFUL=1
709
+ # Create a file that can be checked for
710
+ rm -f /tmp/DAILY_BACKUP_CHECK_SUCCESSFUL
711
+ touch /tmp/DAILY_BACKUP_CHECK_SUCCESSFUL
710
712
711
713
exit
Original file line number Diff line number Diff line change @@ -223,9 +223,10 @@ notify_admin_gui "Starting the Pi-hole update." "You will be notified when it is
223
223
# Create backup first
224
224
if [ -f "\$ SCRIPTS/daily-borg-backup.sh" ]
225
225
then
226
+ rm -f /tmp/DAILY_BACKUP_CREATION_SUCCESSFUL
226
227
export SKIP_DAILY_BACKUP_CHECK=1
227
228
bash "\$ SCRIPTS/daily-borg-backup.sh"
228
- if [ -z " \$ DAILY_BACKUP_CREATION_SUCCESSFUL" ]
229
+ if ! [ -f "/tmp/ DAILY_BACKUP_CREATION_SUCCESSFUL" ]
229
230
then
230
231
notify_admin_gui "Pi-hole update failed because backup could not be created!" \
231
232
"Could not create a backup! \$ (date +%T)"
Original file line number Diff line number Diff line change @@ -134,9 +134,10 @@ then
134
134
fi
135
135
136
136
# Check daily backup
137
+ rm -f /tmp/DAILY_BACKUP_CHECK_SUCCESSFUL
137
138
export SKIP_DAILY_BACKUP_CREATION=1
138
139
bash " $SCRIPTS /daily-borg-backup.sh"
139
- if [ -z " $ DAILY_BACKUP_CHECK_SUCCESSFUL" ]
140
+ if ! [ -f " /tmp/ DAILY_BACKUP_CHECK_SUCCESSFUL" ]
140
141
then
141
142
send_error_mail " Daily backup check failed!" \
142
143
" Backup check was unsuccessful! $( date +%T) "
Original file line number Diff line number Diff line change @@ -113,11 +113,15 @@ then
113
113
then
114
114
exit 1
115
115
fi
116
+ rm -f /tmp/DAILY_BACKUP_CREATION_SUCCESSFUL
116
117
export SKIP_DAILY_BACKUP_CHECK=1
117
118
bash " $DAILY_BACKUP_FILE "
118
- if ! yesno_box_no " Was the backup successfully? If yes, we will continue with the restore script now. "
119
+ if ! [ -f " /tmp/DAILY_BACKUP_CREATION_SUCCESSFUL " ]
119
120
then
120
- exit 1
121
+ if ! yesno_box_no " It seems like the backup was not successful. Do you want to continue nonetheless? (Not recommended!)"
122
+ then
123
+ exit 1
124
+ fi
121
125
fi
122
126
fi
123
127
You can’t perform that action at this time.
0 commit comments