File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
share/github-backup-utils Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -21,22 +21,29 @@ ghe_remote_version_required "$GHE_HOSTNAME"
21
21
ghe-ssh " $GHE_HOSTNAME " /bin/bash << EOF
22
22
set -e
23
23
24
+ if which ghe-redis-cli > /dev/null; then
25
+ redis_cli=ghe-redis-cli
26
+ redis_arg=--remote
27
+ else
28
+ redis_cli=redis-cli
29
+ redis_arg=
30
+ fi
24
31
redis_host=\$ (ghe-config cluster.redis-master 2>/dev/null || echo "localhost")
25
- timestamp=\$ (ghe-redis-cli --remote -h \$ redis_host LASTSAVE)
32
+ timestamp=\$ (\$ redis_cli \$ redis_arg -h \$ redis_host LASTSAVE)
26
33
27
34
for i in \$ (seq 10); do
28
- if ! ghe-redis-cli --remote -h \$ redis_host BGSAVE | grep -q ERR; then
35
+ if ! \$ redis_cli \$ redis_arg -h \$ redis_host BGSAVE | grep -q ERR; then
29
36
break
30
37
fi
31
38
sleep 15
32
39
done
33
40
for n in \$ (seq 3600); do
34
- if [ "\$ (ghe-redis-cli --remote -h \$ redis_host LASTSAVE)" != "\$ timestamp" ]; then
41
+ if [ "\$ (\$ redis_cli \$ redis_arg -h \$ redis_host LASTSAVE)" != "\$ timestamp" ]; then
35
42
break
36
43
fi
37
44
sleep 1
38
45
done
39
- [ "\$ (ghe-redis-cli --remote -h \$ redis_host LASTSAVE)" != "\$ timestamp" ] # exits 1 if bgsave didn't work
46
+ [ "\$ (\$ redis_cli \$ redis_arg -h \$ redis_host LASTSAVE)" != "\$ timestamp" ] # exits 1 if bgsave didn't work
40
47
41
48
if [ "\$ redis_host" != "localhost" ]; then
42
49
ssh \$ redis_host sudo cat '$GHE_REMOTE_DATA_USER_DIR /redis/dump.rdb'
You can’t perform that action at this time.
0 commit comments