From 2423852470caab3e1e2a93a82dd27a04b27a2dd4 Mon Sep 17 00:00:00 2001 From: Ryan Tomayko Date: Mon, 20 Apr 2015 13:52:46 -0400 Subject: [PATCH 1/3] Fix ghe-backup-settings failure due to new license file perms The license file is now 0400 and owned by the 'git' user. --- share/github-backup-utils/ghe-backup-settings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/github-backup-utils/ghe-backup-settings b/share/github-backup-utils/ghe-backup-settings index 87c9c1d76..1b4e145d2 100755 --- a/share/github-backup-utils/ghe-backup-settings +++ b/share/github-backup-utils/ghe-backup-settings @@ -21,7 +21,7 @@ echo "* Transferring settings data ..." 1>&3 ghe-ssh "$host" -- 'ghe-export-settings' > settings.json echo "* Transferring license data ..." 1>&3 -ghe-ssh "$host" -- "cat '$GHE_REMOTE_LICENSE_FILE'" > enterprise.ghl +ghe-ssh "$host" -- "sudo cat '$GHE_REMOTE_LICENSE_FILE'" > enterprise.ghl if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then echo "* Transferring management console password ..." 1>&3 From f1dc27cf73479e1420e3dccb798f7b2c57e5ae36 Mon Sep 17 00:00:00 2001 From: Ryan Tomayko Date: Mon, 20 Apr 2015 14:22:16 -0400 Subject: [PATCH 2/3] Fix ghe-backup-redis failure due to new rdb file perms The rdb file is now 0700 and owned by the redis user. --- share/github-backup-utils/ghe-backup-redis | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/github-backup-utils/ghe-backup-redis b/share/github-backup-utils/ghe-backup-redis index 10ea8bde6..ff13d7c5d 100755 --- a/share/github-backup-utils/ghe-backup-redis +++ b/share/github-backup-utils/ghe-backup-redis @@ -23,5 +23,5 @@ ghe-ssh "$GHE_HOSTNAME" /bin/sh < Date: Mon, 20 Apr 2015 15:03:15 -0400 Subject: [PATCH 3/3] Only sudo under GHE >= 2.x --- share/github-backup-utils/ghe-backup-redis | 4 +++- share/github-backup-utils/ghe-backup-settings | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/share/github-backup-utils/ghe-backup-redis b/share/github-backup-utils/ghe-backup-redis index ff13d7c5d..dbd1e796f 100755 --- a/share/github-backup-utils/ghe-backup-redis +++ b/share/github-backup-utils/ghe-backup-redis @@ -16,6 +16,8 @@ cd $(dirname "$0")/../.. ghe_remote_version_required "$GHE_HOSTNAME" # Force a redis BGSAVE, and wait for it to complete. +sudo= +[ "$GHE_VERSION_MAJOR" -ge 2 ] && sudo="sudo" ghe-ssh "$GHE_HOSTNAME" /bin/sh <&3 ghe-ssh "$host" -- 'ghe-export-settings' > settings.json echo "* Transferring license data ..." 1>&3 -ghe-ssh "$host" -- "sudo cat '$GHE_REMOTE_LICENSE_FILE'" > enterprise.ghl +comm="cat '$GHE_REMOTE_LICENSE_FILE'" +[ "$GHE_VERSION_MAJOR" -ge 2 ] && comm="sudo $comm" +ghe-ssh "$host" -- "$comm" > enterprise.ghl if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then echo "* Transferring management console password ..." 1>&3