Skip to content

Commit c4a7450

Browse files
committed
Merge pull request #124 from github/perms-fixes
Adjust ghe-backup file access for permissions changes in upcoming release
2 parents 431bc1e + 2db6e90 commit c4a7450

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

share/github-backup-utils/ghe-backup-redis

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ cd $(dirname "$0")/../..
1616
ghe_remote_version_required "$GHE_HOSTNAME"
1717

1818
# Force a redis BGSAVE, and wait for it to complete.
19+
sudo=
20+
[ "$GHE_VERSION_MAJOR" -ge 2 ] && sudo="sudo"
1921
ghe-ssh "$GHE_HOSTNAME" /bin/sh <<EOF
2022
set -e
2123
timestamp=\$(redis-cli LASTSAVE)
2224
redis-cli BGSAVE 1>/dev/null
2325
while [ \$(redis-cli LASTSAVE) -eq \$timestamp ]; do
2426
sleep 1
2527
done
26-
cat '$GHE_REMOTE_DATA_USER_DIR/redis/dump.rdb'
28+
$sudo cat '$GHE_REMOTE_DATA_USER_DIR/redis/dump.rdb'
2729
EOF

share/github-backup-utils/ghe-backup-settings

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ echo "* Transferring settings data ..." 1>&3
2121
ghe-ssh "$host" -- 'ghe-export-settings' > settings.json
2222

2323
echo "* Transferring license data ..." 1>&3
24-
ghe-ssh "$host" -- "cat '$GHE_REMOTE_LICENSE_FILE'" > enterprise.ghl
24+
comm="cat '$GHE_REMOTE_LICENSE_FILE'"
25+
[ "$GHE_VERSION_MAJOR" -ge 2 ] && comm="sudo $comm"
26+
ghe-ssh "$host" -- "$comm" > enterprise.ghl
2527

2628
if [ "$GHE_VERSION_MAJOR" -ge 2 ]; then
2729
echo "* Transferring management console password ..." 1>&3

0 commit comments

Comments
 (0)