Skip to content

Commit 1ba5575

Browse files
committed
Adding new option to exclude Pages from backup and restore.
1 parent 5fdf66b commit 1ba5575

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

backup.config-example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,6 @@ GHE_NUM_SNAPSHOTS=10
9595
# When running an external mysql database, run this script to trigger a MySQL restore
9696
# rather than attempting to backup via backup-utils directly.
9797
#EXTERNAL_DATABASE_RESTORE_SCRIPT="/bin/false"
98+
99+
# If set to 'yes', Pages data will be included in backup and restore. Defaults to 'yes'
100+
#GHE_BACKUP_PAGES=no

bin/ghe-backup

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,12 @@ commands+=("
238238
echo \"$cmd_title\"
239239
ghe-backup-repositories || printf %s \"repositories \" >> \"$failures_file\"")
240240

241-
cmd_title=$(log_info "Backing up GitHub Pages artifacts ...")
242-
commands+=("
243-
echo \"$cmd_title\"
244-
ghe-backup-pages || printf %s \"pages \" >> \"$failures_file\"")
241+
if [ "$GHE_BACKUP_PAGES" != "no" ]; then
242+
cmd_title=$(log_info "Backing up GitHub Pages artifacts ...")
243+
commands+=("
244+
echo \"$cmd_title\"
245+
ghe-backup-pages || printf %s \"pages \" >> \"$failures_file\"")
246+
fi
245247

246248
cmd_title=$(log_info "Backing up storage data ...")
247249
commands+=("

bin/ghe-restore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,12 @@ commands+=("
459459
echo \"$cmd_title\"
460460
ghe-restore-repositories-gist \"$GHE_HOSTNAME\"")
461461

462-
cmd_title=$(log_info "Restoring Pages ...")
463-
commands+=("
464-
echo \"$cmd_title\"
465-
ghe-restore-pages \"$GHE_HOSTNAME\" 1>&3")
462+
if [ "$GHE_BACKUP_PAGES" != "no" ]; then
463+
cmd_title=$(log_info "Restoring Pages ...")
464+
commands+=("
465+
echo \"$cmd_title\"
466+
ghe-restore-pages \"$GHE_HOSTNAME\" 1>&3")
467+
fi
466468

467469
cmd_title=$(log_info "Restoring SSH authorized keys ...")
468470
commands+=("

0 commit comments

Comments
 (0)