@@ -388,7 +388,7 @@ log_warn "Warning: storing backup-utils version remotely failed."
388
388
# Stop cron and timerd, as scheduled jobs may disrupt the restore process.
389
389
log_info " Stopping cron and github-timerd ..."
390
390
if $CLUSTER ; then
391
- bm_start " basename( $0 ) - Stopping cron and github-timerd on cluster"
391
+ bm_start " $( basename $0 ) - Stopping cron and github-timerd on cluster"
392
392
if ! ghe-ssh " $GHE_HOSTNAME " -- " ghe-cluster-each -- sudo service cron stop" ; then
393
393
log_warn " Failed to stop cron on one or more nodes" 1>&3
394
394
fi
420
420
log_warn " Failed to stop github-timerd" 1>&3
421
421
fi
422
422
fi
423
- bm_end " basename( $0 ) - Stopping cron and github-timerd on cluster"
423
+ bm_end " $( basename $0 ) - Stopping cron and github-timerd on cluster"
424
424
fi
425
425
CRON_RUNNING=false
426
426
442
442
# Restore UUID if present and not restoring to cluster.
443
443
if [ -s " $GHE_RESTORE_SNAPSHOT_PATH /uuid" ] && ! $CLUSTER ; then
444
444
log_info " Restoring UUID ..."
445
- bm_start " basename( $0 ) - Restore UUID"
445
+ bm_start " $( basename $0 ) - Restore UUID"
446
446
cat " $GHE_RESTORE_SNAPSHOT_PATH /uuid" |
447
447
ghe-ssh " $GHE_HOSTNAME " -- " sudo sponge '$GHE_REMOTE_DATA_USER_DIR /common/uuid' 2>/dev/null"
448
448
ghe-ssh " $GHE_HOSTNAME " -- " sudo systemctl stop consul" || true
449
449
ghe-ssh " $GHE_HOSTNAME " -- " sudo rm -rf /data/user/consul/raft"
450
- bm_end " basename( $0 ) - Restore UUID"
450
+ bm_end " $( basename $0 ) - Restore UUID"
451
451
fi
452
452
453
453
if is_external_database_snapshot; then
498
498
cmd_title=$( log_info " Restoring Redis database ..." )
499
499
commands=("
500
500
echo \" $cmd_title \"
501
- bm_start \" basename( $0 ) - Restoring Redis\"
501
+ bm_start \" $( basename $0 ) - Restoring Redis\"
502
502
ghe-ssh \" $GHE_HOSTNAME \" -- 'ghe-import-redis' < \" $GHE_RESTORE_SNAPSHOT_PATH /redis.rdb\" 1>&3
503
- bm_end \" basename( $0 ) - Restoring Redis\" " )
503
+ bm_end \" $( basename $0 ) - Restoring Redis\" " )
504
504
505
505
cmd_title=$( log_info " Restoring Git Repositories ..." )
506
506
commands+=("
@@ -520,9 +520,9 @@ ghe-restore-pages \"$GHE_HOSTNAME\" 1>&3")
520
520
cmd_title=$( log_info " Restoring SSH authorized keys ..." )
521
521
commands+=("
522
522
echo \" $cmd_title \"
523
- bm_start \" basename( $0 ) -Restoring SSH authorized keys\"
523
+ bm_start \" $( basename $0 ) -Restoring SSH authorized keys\"
524
524
ghe-ssh \" $GHE_HOSTNAME \" -- 'ghe-import-authorized-keys' < \" $GHE_RESTORE_SNAPSHOT_PATH /authorized-keys.json\" 1>&3
525
- bm_end \" basename( $0 ) -Restoring SSH authorized keys\" " )
525
+ bm_end \" $( basename $0 ) -Restoring SSH authorized keys\" " )
526
526
527
527
cmd_title=$( log_info " Restoring storage data ..." )
528
528
commands+=("
575
575
576
576
# Restart an already running memcached to reset the cache after restore
577
577
log_info " Restarting memcached ..." 1>&3
578
- bm_start " basename( $0 ) - Restarting memcached"
578
+ bm_start " $( basename $0 ) - Restarting memcached"
579
579
echo " sudo restart -q memcached 2>/dev/null || true" |
580
580
ghe-ssh " $GHE_HOSTNAME " -- /bin/sh
581
- bm_end " basename( $0 ) - Restarting memcached"
581
+ bm_end " $( basename $0 ) - Restarting memcached"
582
582
583
583
# Prevent GitHub Connect jobs running before we've had a chance to reset
584
584
# the configuration by setting the last run date to now.
592
592
# config run to perform data migrations.
593
593
if $CLUSTER ; then
594
594
log_info " Configuring cluster ..."
595
- bm_start " basename( $0 ) - configure cluster"
595
+ bm_start " $( basename $0 ) - configure cluster"
596
596
if [ " $GHE_VERSION_MAJOR " -eq " 3" ]; then
597
597
ghe-ssh " $GHE_HOSTNAME " -- " ghe-cluster-nomad-cleanup" 1>&3 2>&3
598
598
elif [ " $GHE_VERSION_MAJOR " -eq " 2" ] && [ " $GHE_VERSION_MINOR " -eq " 22" ]; then
@@ -609,7 +609,7 @@ elif $instance_configured; then
609
609
ghe-ssh " $GHE_HOSTNAME " -- " /usr/local/share/enterprise/ghe-nomad-cleanup" 1>&3 2>&3
610
610
fi
611
611
ghe-ssh " $GHE_HOSTNAME " -- " ghe-config-apply" 1>&3 2>&3
612
- bm_end " basename( $0 ) - configure cluster"
612
+ bm_end " $( basename $0 ) - configure cluster"
613
613
fi
614
614
615
615
# Clear GitHub Connect settings stored in the restored database.
@@ -627,7 +627,7 @@ CRON_RUNNING=true
627
627
# Clean up all stale replicas on configured instances.
628
628
if ! $CLUSTER && $instance_configured ; then
629
629
log_info " Cleaning up replicas..." 1>&3
630
- bm_start " basename( $0 ) - Cleanup replicas"
630
+ bm_start " $( basename $0 ) - Cleanup replicas"
631
631
restored_uuid=$( cat $GHE_RESTORE_SNAPSHOT_PATH /uuid)
632
632
other_nodes=$( echo "
633
633
set -o pipefail; \
@@ -643,7 +643,7 @@ if ! $CLUSTER && $instance_configured; then
643
643
echo " set -o pipefail; $( typeset -f cleanup_cluster_nodes) ; cleanup_cluster_nodes $uuid " | ghe-ssh " $GHE_HOSTNAME " 1>&3
644
644
done
645
645
fi
646
- bm_end " basename( $0 ) - Cleanup replicas"
646
+ bm_end " $( basename $0 ) - Cleanup replicas"
647
647
fi
648
648
649
649
# Update the remote status to "complete". This has to happen before importing
0 commit comments