Skip to content

Commit 294e4bb

Browse files
committed
Detect storage user on each host being backed up/restored
1 parent 87fcc94 commit 294e4bb

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

share/github-backup-utils/ghe-backup-storage

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,11 @@ if ! ls $tempdir/*.rsync >/dev/null 2>&1; then
113113
exit 0
114114
fi
115115

116-
storage_user=$(ghe-ssh "$GHE_HOSTNAME" -- stat -c %U /data/user/storage || echo git)
117-
118116
# rsync all the storage objects
119117
bm_start "$(basename $0) - Storage object sync"
120118
for file_list in $tempdir/*.rsync; do
121119
hostname=$(basename $file_list .rsync)
120+
storage_user=$(ghe-ssh $ssh_config_file_opt $hostname:$port -- stat -c %U /data/user/storage || echo git)
122121

123122
object_num=$(cat $file_list | wc -l)
124123
ghe_verbose "* Transferring $object_num objects from $hostname"

share/github-backup-utils/ghe-restore-storage

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ if ! ls $tempdir/*.rsync >/dev/null 2>&1; then
119119
exit 0
120120
fi
121121

122-
storage_user=$(ghe-ssh "$GHE_HOSTNAME" -- stat -c %U /data/user/storage || echo git)
123-
124122
# rsync all the objects to the storage server where they belong.
125123
# One rsync invocation per server available.
126124
bm_start "$(basename $0) - Restoring objects"
@@ -130,6 +128,8 @@ for file_list in $tempdir/*.rsync; do
130128
else
131129
server=$host
132130
fi
131+
storage_user=$(ghe-ssh $ssh_config_file_opt $server:$port -- stat -c %U /data/user/storage || echo git)
132+
133133
ghe_verbose "* Transferring data to $server ..."
134134
ghe-rsync -arvHR --delete \
135135
-e "ssh -q $opts -p $port $ssh_config_file_opt -l $user" \

0 commit comments

Comments
 (0)