Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ storage and must have network connectivity with the GitHub Enterprise appliance.
##### Backup host requirements

Backup host software requirements are modest: Linux or other modern Unix
operating system with [rsync][4] v2.6.4 or newer.
operating system with bash and [rsync][4] v2.6.4 or newer.

The backup host must be able to establish network connections outbound to the
GitHub appliance over SSH. TCP port 122 is used to backup GitHub Enterprise 2.0 or newer instances, and TCP port 22 is used for older versions (11.10.34X).
Expand Down Expand Up @@ -211,8 +211,8 @@ backup snapshot of all relevant data stores. Repository, Search, and Pages data
is stored efficiently via hard links.

*Please note* Symlinks must be maintained when archiving backup snapshots.
Dereferencing or excluding symlinks, or storing the snapshot contents on a
filesystem which does not support symlinks will result in operational
Dereferencing or excluding symlinks, or storing the snapshot contents on a
filesystem which does not support symlinks will result in operational
problems when the data is restored.

The following example shows a snapshot file hierarchy for hourly frequency.
Expand Down
2 changes: 1 addition & 1 deletion bin/ghe-backup
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup [-v]
#/ Take snapshots of all GitHub Enterprise data, including Git repository data,
#/ the MySQL database, instance settings, GitHub Pages data, etc.
Expand Down
2 changes: 1 addition & 1 deletion bin/ghe-host-check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-host-check [<host>]
#/ Verify connectivity with the GitHub Enterprise host. When no <host> is
#/ provided, the $GHE_HOSTNAME configured in backup.config is assumed.
Expand Down
2 changes: 1 addition & 1 deletion bin/ghe-restore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-restore [-v] [-s <snapshot-id>] [<host>]
#/ Restores a GitHub instance from local backup snapshots. The <host> is the
#/ hostname or IP of the GitHub instance. The <host> may be omitted when
Expand Down
2 changes: 1 addition & 1 deletion script/cibuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: script/cibuild [--no-package]
set -e

Expand Down
2 changes: 1 addition & 1 deletion script/package-deb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: script/package-deb
# Script to build a deb release package from the current HEAD version.
# The package version comes from the debian/changelog file so that should
Expand Down
2 changes: 1 addition & 1 deletion script/package-tarball
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: script/package-tarball
# Script to build a tarball release package from the current HEAD version.
# The package version comes from `git-describe --tags' so the release tag should
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-alambic-cluster
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-alambic-cluster
#/ Take an online, incremental snapshot of all Alambic Storage data
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: . ghe-backup-config
# GitHub Enterprise backup shell configuration.
#
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-es-audit-log
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-es-audit-log
#/ Take a backup of audit logs in ElasticSearch.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-es-hookshot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-es-hookshot
#/ Take a backup of hookshot logs in ElasticSearch.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-es-rsync
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-es-rsync
#/ Take an online, incremental snapshot of Elasticsearch indices.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-es-tarball
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-es-tarball
#/ Take a tarball snapshot of all Elasticsearch data.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-pages-cluster
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-pages-cluster
#/ Take an online, incremental snapshot of all Pages data
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-pages-rsync
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-pages-rsync
#/ Take an online, incremental snapshot of all Pages data.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-pages-tarball
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-pages-tarball
#/ Take a tarball snapshot of all Pages data.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-redis
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-redis
#/ Take a snapshot of all Redis data. This is needed because older versions of
#/ the remote side ghe-export-redis command use a blocking SAVE instead of a
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-redis-cluster
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-redis-cluster
#/ Take a snapshot of all Redis data. This is needed because older versions of
#/ the remote side ghe-export-redis command use a blocking SAVE instead of a
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-repositories-cluster
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-repositories-cluster
#/ Take an online, incremental snapshot of all Git repository data.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-repositories-rsync
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-repositories-rsync
#/ Take an online, incremental snapshot of all Git repository data.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-repositories-tarball
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-repositories-tarball
#/ Take a tarball snapshot of all Git repository data.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-settings
#/ Restore settings from a snapshot to the given <host>.
set -e
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-backup-userdata
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-backup-userdata <dirname>
#/ Take an online, incremental snapshot of a user data directory. This is used
#/ for a number of different simple datastores kept under /data/user on the
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-maintenance-mode-disable
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-maintenance-mode-disable <host>
#/ Disable maintenance mode on GitHub appliance at <host>. This opens up access
#/ to the appliance.
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-maintenance-mode-enable
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-maintenance-mode-enable [-w] <host>
#/ Enable maintenance mode on GitHub appliance at <host>. This locks down all
#/ access to the appliance to prevent writes to datastores and waits for all
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-maintenance-mode-status
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-maintenance-mode-status <host>
#/ Checks the status of maintenance mode on GitHub appliance at <host>.
set -e
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-prune-snapshots
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-prune-snapshots
#/ Keep N latest backup snapshots.
set -e
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-restore-es-audit-log
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-restore-es-audit-log
#/ Take a backup of audit logs in ElasticSearch.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-restore-es-rsync
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-restore-es-rsync <host>
#/ Restore an rsync snapshot of all Elasticsearch data to a GitHub instance.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-restore-es-tarball
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-restore-es-tarball <host>
#/ Restore a tarball snapshot of all ES data to a GitHub instance.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-restore-pages-rsync
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-restore-pages-rsync <host>
#/ Restore an rsync snapshot of all Pages data to a GitHub instance.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-restore-pages-tarball
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-restore-pages-tarball <host>
#/ Restore a tarball snapshot of all Pages data to a GitHub instance.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-restore-repositories-rsync
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-restore-repositories-rsync <host>
#/ Restore an rsync snapshot of all Git repository data to a GitHub instance.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-restore-repositories-tarball
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-restore-repositories-tarball <host>
#/ Restore a tarball snapshot of all Git repository data to a GitHub instance.
#/
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-restore-settings
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-restore-settings <host>
#/ Restore settings from a snapshot to the given <host>.
set -e
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-restore-snapshot-path
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-restore-snapshot-path [snapshot]
#/
#/ Print the path to the given snapshot. Defaults to current if no argument given.
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-restore-userdata
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-restore-userdata <dirname> <host>
#/ Restore a special user data directory via rsync. This is used
#/ for a number of different simple datastores kept under /data/user on the
Expand Down
2 changes: 1 addition & 1 deletion share/github-backup-utils/ghe-ssh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#/ Usage: ghe-ssh [<option>...] <host> [<simple-command>...]
#/ echo 'set -o pipefail; <complex-command>...' | ghe-ssh [<option>...] <host> /bin/bash
#/ Helper to ssh into a GitHub instance with the right user and port. The first
Expand Down
2 changes: 1 addition & 1 deletion test/bin/chown
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Fake chown command for tests. Avoids needing to creating special users for
# utlities that chown on the remote side.
true
2 changes: 1 addition & 1 deletion test/bin/curl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: curl ...
# Fake curl command stub for tests.
set -e
Expand Down
2 changes: 1 addition & 1 deletion test/bin/enterprise-configure
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: enterprise-configure
# Emulates the remote GitHub enterprise-configure command. Tests use this
# to assert that the command was executed.
Expand Down
2 changes: 1 addition & 1 deletion test/bin/ghe-config-apply
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: ghe-config-apply
# Emulates the remote GitHub ghe-config-apply command. Tests use this
# to assert that the command was executed.
Expand Down
2 changes: 1 addition & 1 deletion test/bin/ghe-es-snapshot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: ghe-es-snapshot
# Emulates the remote GitHub ghe-service-ensure-mysql command. Tests use this
# to assert that the command was executed.
Expand Down
2 changes: 1 addition & 1 deletion test/bin/ghe-fake-export-command
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Emulates a remote GitHub export command. Each of the ghe-export-* utilities
# that are run on the remote side have corresponding commands in this directory
# that symlink to this file. The command outputs a simple bit of text including
Expand Down
2 changes: 1 addition & 1 deletion test/bin/ghe-fake-import-command
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Emulates a remote GitHub import command. Each of the ghe-import-* utilities
# that are run on the remote side have corresponding commands in this directory
# that symlink to this file. The command just gobbles up stdin and writes a
Expand Down
2 changes: 1 addition & 1 deletion test/bin/ghe-maintenance
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Emulates a remote GitHub ghe-maintenance command. Tests use this to assert
# that a command was executed.
true
2 changes: 1 addition & 1 deletion test/bin/ghe-service-ensure-elasticsearch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: ghe-service-ensure-mysql
# Emulates the remote GitHub ghe-service-ensure-mysql command. Tests use this
# to assert that the command was executed.
Expand Down
2 changes: 1 addition & 1 deletion test/bin/ghe-service-ensure-mysql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: ghe-service-ensure-mysql
# Emulates the remote GitHub ghe-service-ensure-mysql command. Tests use this
# to assert that the command was executed.
Expand Down
2 changes: 1 addition & 1 deletion test/bin/ionice-stub
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh
#!/usr/bin/env bash
# Fake ionice command for environments that don't support it.
exec "$@"
2 changes: 1 addition & 1 deletion test/bin/python
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: python -c '...'
# Fake python command stub for tests. Python is used on the remote side
# only to parse JSON data retreived from the maintenance status API and produce
Expand Down
2 changes: 1 addition & 1 deletion test/bin/redis-cli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: redis-cli ...
# Fake redis-cli command stub for tests. The redis-cli utlity is run on the
# remote side by libexec/ghe-backup-redis to force a background save of redis
Expand Down
2 changes: 1 addition & 1 deletion test/bin/ssh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: ssh [-o opt=val]... <host> <command>...
# Fake ssh command that executes <command> locally. This is placed on PATH
# during tests to fake out a remote host. Both normal ssh invocations and rsync
Expand Down
2 changes: 1 addition & 1 deletion test/test-bashisms.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# bashisms tests

# Bring in testlib
Expand Down
2 changes: 1 addition & 1 deletion test/test-ghe-backup-config.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# ghe-backup-config lib tests

# Bring in testlib
Expand Down
2 changes: 1 addition & 1 deletion test/test-ghe-backup-repositories-rsync-nw.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# ghe-backup-repositories-rsync-nw command tests
# uses the net-shard filesystem layout

Expand Down
2 changes: 1 addition & 1 deletion test/test-ghe-backup-repositories-rsync.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# ghe-backup-repositories-rsync command tests

# Bring in testlib
Expand Down
2 changes: 1 addition & 1 deletion test/test-ghe-backup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# ghe-backup command tests

# Bring in testlib
Expand Down
2 changes: 1 addition & 1 deletion test/test-ghe-host-check.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# ghe-host-check command tests

# Bring in testlib
Expand Down
2 changes: 1 addition & 1 deletion test/test-ghe-prune-snapshots.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# ghe-prune-snapshots command tests

# Bring in testlib
Expand Down
2 changes: 1 addition & 1 deletion test/test-ghe-restore.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# ghe-restore command tests

# Bring in testlib
Expand Down
2 changes: 1 addition & 1 deletion test/test-ghe-ssh.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# ghe-ssh command tests

# Bring in testlib
Expand Down
2 changes: 1 addition & 1 deletion test/testlib.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
# Usage: . testlib.sh
# Simple shell command language test library.
#
Expand Down