File tree 4 files changed +16
-16
lines changed
4 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,6 @@ get_expiration_time() {
15
15
DURATION_READABLE=$( printf " %02d hours %02d minutes %02d seconds" $DURATION_HOUR $DURATION_MIN $DURATION_SEC )
16
16
}
17
17
18
- # Export defaults
19
- export BORG_PASSPHRASE=" $BORG_PASSWORD "
20
- export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes
21
- export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes
22
-
23
18
# Test if all volumes aren't empty
24
19
VOLUME_DIRS=" $( find /nextcloud_aio_volumes -mindepth 1 -maxdepth 1 -type d) "
25
20
mapfile -t VOLUME_DIRS <<< " $VOLUME_DIRS"
@@ -168,7 +163,7 @@ if [ "$BORG_MODE" = restore ]; then
168
163
169
164
# Perform the restore
170
165
if [ -n " $SELECTED_RESTORE_TIME " ]; then
171
- SELECTED_ARCHIVE" $( borg list " $BORG_BACKUP_DIRECTORY " | grep " nextcloud-aio" | grep " $SELECTED_RESTORE_TIME " | awk -F " " ' {print $1}' | head -1) "
166
+ SELECTED_ARCHIVE= " $( borg list " $BORG_BACKUP_DIRECTORY " | grep " nextcloud-aio" | grep " $SELECTED_RESTORE_TIME " | awk -F " " ' {print $1}' | head -1) "
172
167
else
173
168
SELECTED_ARCHIVE=" $( borg list " $BORG_BACKUP_DIRECTORY " | grep " nextcloud-aio" | awk -F " " ' {print $1}' | sort -r | head -1) "
174
169
fi
Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ if [ -z "$BORG_PASSWORD" ]; then
9
9
exit 1
10
10
fi
11
11
12
- export BORG_PASSWORD
12
+ # Export defaults
13
+ export BORG_PASSPHRASE=" $BORG_PASSWORD "
14
+ export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes
15
+ export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes
13
16
14
17
# Validate BORG_MODE
15
18
if [ " $BORG_MODE " != backup ] && [ " $BORG_MODE " != restore ] && [ " $BORG_MODE " != check ]; then
Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ public function GetLastBackupTime() : string {
64
64
}
65
65
66
66
$ content = file_get_contents (DataConst::GetBackupArchivesList ());
67
- if (count ( $ content) === 0 ) {
67
+ if ($ content === '' ) {
68
68
return '' ;
69
69
}
70
70
@@ -85,23 +85,25 @@ public function GetLastBackupTime() : string {
85
85
86
86
public function GetBackupTimes () : array {
87
87
if (!file_exists (DataConst::GetBackupArchivesList ())) {
88
- return $ array [] = '' ;
88
+ return [] ;
89
89
}
90
90
91
91
$ content = file_get_contents (DataConst::GetBackupArchivesList ());
92
- if (count ( $ content) === 0 ) {
93
- return $ array [] = '' ;
92
+ if ($ content === '' ) {
93
+ return [] ;
94
94
}
95
95
96
- $ backupLines = explode (' \n ' , $ content );
96
+ $ backupLines = explode ("\n" , $ content );
97
97
$ backupTimes = [];
98
98
foreach ($ backupLines as $ lines ) {
99
- $ backupTimesTemp = explode (', ' , $ lines );
100
- $ backupTimes [] = $ backupTimesTemp [1 ];
99
+ if ($ lines !== "" ) {
100
+ $ backupTimesTemp = explode (', ' , $ lines );
101
+ $ backupTimes [] = $ backupTimesTemp [1 ];
102
+ }
101
103
}
102
104
103
105
if (!is_array ($ backupTimes )) {
104
- return $ array [] = '' ;
106
+ return [] ;
105
107
}
106
108
107
109
return $ backupTimes ;
Original file line number Diff line number Diff line change 212
212
<input type =" hidden" name =" {{csrf .keys .value }}" value =" {{csrf .value }}" >
213
213
<select id =" selected_restore_time" name =" selected_restore_time" form =" restore_selection" >
214
214
{% for restore_time in backup_times %}
215
- <option value =" {{ restore_time }}" >{{ restore_time }}" </option >
215
+ <option value =" {{ restore_time }}" >{{ restore_time }}</option >
216
216
{% endfor %}
217
217
</select >
218
218
<input class =" button" type =" submit" value =" Restore selected backup" onclick =" return confirm('Restore the selected backup? Are you sure that you want to restore the selected backup? This will stop all running containers and restore the selected backup. It is recommended to create a backup first. You might also want to check the backup integrity.')" />
You can’t perform that action at this time.
0 commit comments