File tree Expand file tree Collapse file tree 4 files changed +45
-2
lines changed
share/github-backup-utils Expand file tree Collapse file tree 4 files changed +45
-2
lines changed Original file line number Diff line number Diff line change 294294 ghe-restore-es-${GHE_BACKUP_STRATEGY} " $GHE_HOSTNAME " 1>&3
295295fi
296296
297+ echo " Restoring hookshot logs ..."
298+ ghe-restore-es-hookshot " $GHE_HOSTNAME " 1>&3
299+
297300# Restart an already running memcached to reset the cache after restore
298301if [ " $GHE_VERSION_MAJOR " -ge 2 ]; then
299302 echo " Restarting memcached ..." 1>&3
334337 echo " Restoring Git over SSH host keys ..."
335338 ghe-ssh " $GHE_HOSTNAME " -- " sudo tar -xpf - -C /data/user/common" < " $GHE_RESTORE_SNAPSHOT_PATH /ssh-host-keys.tar" 1>&3
336339 ghe-ssh " $GHE_HOSTNAME " -- " sudo chown babeld:babeld /data/user/common/ssh_host_*" 1>&3
337- ghe-ssh " $GHE_HOSTNAME " -- " /usr/local/share/enterprise/ghe-cluster-config-update -s" 1>&3
340+ echo " if [ -f /usr/local/share/enterprise/ghe-cluster-config-update ]; then /usr/local/share/enterprise/ghe-cluster-config-update -s; else /usr/local/bin/ghe-cluster-config-update -s; fi" |
341+ ghe-ssh " $GHE_HOSTNAME " -- /bin/sh 1>&3
338342fi
339343
340344echo " Completed restore of $GHE_HOSTNAME from snapshot $GHE_RESTORE_SNAPSHOT "
Original file line number Diff line number Diff line change 1+ github-backup-utils (2.7.0) UNRELEASED; urgency=medium
2+
3+ * GitHub Enterprise 2.7.0 support
4+
5+ -- Sergio Rubio <
[email protected] > Wed, 03 Aug 2016 20:25:31 +0200
6+
17github-backup-utils (2.6.4) UNRELEASED; urgency=medium
28
39 * Instrument/benchmark backups #238
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # / Usage: ghe-restore-es-hookshot
3+ # / Restores a backup of hookshot logs to ElasticSearch.
4+ # /
5+ # / Note: This command typically isn't called directly. It's invoked by
6+ # / ghe-restore.
7+ set -e
8+
9+ # Bring in the backup configuration
10+ . $( dirname " ${BASH_SOURCE[0]} " ) /ghe-backup-config
11+
12+ # Show usage and bail with no arguments
13+ [ $# -lt 1 ] && print_usage
14+
15+ bm_start " $( basename $0 ) "
16+
17+ GHE_HOSTNAME=" $1 "
18+
19+ # Perform a host-check and establish GHE_REMOTE_XXX variables.
20+ ghe_remote_version_required " $GHE_HOSTNAME "
21+
22+ last_index=$( ghe-ssh " $GHE_HOSTNAME " ' curl -s "localhost:9201/_cat/indices/hookshot-logs-*"' | cut -d ' ' -f 3 | sort | tail -1)
23+
24+ indices=$( ls -1 $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT /hookshot/* .gz 2> /dev/null | xargs -I{} -n1 basename {} .gz)
25+
26+ for index in $indices ; do
27+ if [ -z " $last_index " ] || ! [ $index \< $last_index ]; then
28+ ghe_verbose " * Restoring $index "
29+ gzip -dc $GHE_DATA_DIR /$GHE_RESTORE_SNAPSHOT /hookshot/$index .gz | ghe-ssh " $GHE_HOSTNAME " " /usr/local/share/enterprise/ghe-es-load-json 'http://localhost:9201/$index '" 1>&3
30+ fi
31+ done
32+
33+ bm_end " $( basename $0 ) "
Original file line number Diff line number Diff line change 1- 2.6.4
1+ 2.7.0
You can’t perform that action at this time.
0 commit comments