File tree Expand file tree Collapse file tree 2 files changed +13
-27
lines changed
share/github-backup-utils Expand file tree Collapse file tree 2 files changed +13
-27
lines changed Original file line number Diff line number Diff line change @@ -191,31 +191,6 @@ PATH="$GHE_BACKUP_ROOT/bin:$GHE_BACKUP_ROOT/share/github-backup-utils:$PATH"
191
191
# backup.config value when set.
192
192
GHE_HOSTNAME_PRESERVE=" $GHE_HOSTNAME "
193
193
194
- # Source in the backup config file from the copy specified in the environment
195
- # first and then fall back to the backup-utils root, home directory and system.
196
- config_found=false
197
- for f in " $GHE_BACKUP_CONFIG " " $GHE_BACKUP_ROOT /backup.config" \
198
- " $HOME /.github-backup-utils/backup.config" " /etc/github-backup-utils/backup.config" ; do
199
- if [ -f " $f " ]; then
200
- GHE_BACKUP_CONFIG=" $f "
201
- # shellcheck disable=SC1090 # This is a user-supplied value that can't be predicted
202
- . " $GHE_BACKUP_CONFIG "
203
- config_found=true
204
- break
205
- fi
206
- done
207
-
208
- # If we don't have a readlink command, error out
209
- ! type readlink 1> /dev/null 2>&1 && {
210
- echo " Error: readlink not found. Please install readlink and ensure it is in your PATH." 1>&2
211
- exit 1
212
- }
213
-
214
- GHE_RESTORE_IN_PROGRESS=$( readlink -fm " ${GHE_DATA_DIR} /in-progress-restore" )
215
- GHE_BACKUP_IN_PROGRESS=$( readlink -fm " ${GHE_DATA_DIR} /in-progress-backup" )
216
-
217
- export GHE_RESTORE_IN_PROGRESS
218
- export GHE_BACKUP_IN_PROGRESS
219
194
220
195
ghe_restore_check () {
221
196
if [ -h " $GHE_RESTORE_IN_PROGRESS " ]; then
Original file line number Diff line number Diff line change @@ -17,9 +17,20 @@ prune_snapshot() {
17
17
# ignore any directory that is included in inc_full_backup or inc_snapshot_data
18
18
# the files should be filtered out earlier, but this is a safeguard to make sure.
19
19
# inc_previous_* and prune_inc_previous are ignored by default
20
- if grep -q " $prune_dir " " $GHE_DATA_DIR /inc_full_backup" || grep " $prune_dir " " $GHE_DATA_DIR /inc_snapshot_data" ; then
21
- continue
20
+ if [ -f " $GHE_DATA_DIR /inc_full_backup" ]; then
21
+ if grep -q " $prune_dir " " $GHE_DATA_DIR " /inc_full_backup; then
22
+ log_info " Skipping incremental backup directory: $prune_dir " 1>&3
23
+ continue
24
+ fi
25
+ fi
26
+
27
+ if [ -f " $GHE_DATA_DIR /inc_snapshot_data" ]; then
28
+ if grep -q " $prune_dir " " $GHE_DATA_DIR " /inc_snapshot_data; then
29
+ log_info " Skipping incremental backup directory: $prune_dir " 1>&3
30
+ continue
31
+ fi
22
32
fi
33
+
23
34
# skip if the directory is not a directory or blank
24
35
if [ ! -d " $prune_dir " ] || [ -z " $prune_dir " ]; then
25
36
log_info " Skipping blank or non-directory: $prune_dir " 1>&3
You can’t perform that action at this time.
0 commit comments