Skip to content

Commit 223ff24

Browse files
authored
Merge pull request #188 from github/use-ghe-redis-cli
Replace redis-cli with ghe-redis-cli
2 parents cd619ae + 82dcb2d commit 223ff24

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ ghe-ssh "$GHE_HOSTNAME" /bin/bash <<EOF
2222
set -e
2323
2424
redis_host=\$(ghe-config cluster.redis-master 2>/dev/null || echo "localhost")
25-
timestamp=\$(redis-cli -h \$redis_host LASTSAVE)
25+
timestamp=\$(ghe-redis-cli --remote -h \$redis_host LASTSAVE)
2626
2727
for i in \$(seq 10); do
28-
if ! redis-cli -h \$redis_host BGSAVE | grep -q ERR; then
28+
if ! ghe-redis-cli --remote -h \$redis_host BGSAVE | grep -q ERR; then
2929
break
3030
fi
3131
sleep 15
3232
done
3333
for n in \$(seq 3600); do
34-
if [ "\$(redis-cli -h \$redis_host LASTSAVE)" != "\$timestamp" ]; then
34+
if [ "\$(ghe-redis-cli --remote -h \$redis_host LASTSAVE)" != "\$timestamp" ]; then
3535
break
3636
fi
3737
sleep 1
3838
done
39-
[ "\$(redis-cli -h \$redis_host LASTSAVE)" != "\$timestamp" ] # exits 1 if bgsave didn't work
39+
[ "\$(ghe-redis-cli --remote -h \$redis_host LASTSAVE)" != "\$timestamp" ] # exits 1 if bgsave didn't work
4040
4141
if [ "\$redis_host" != "localhost" ]; then
4242
ssh \$redis_host sudo cat '$GHE_REMOTE_DATA_USER_DIR/redis/dump.rdb'

test/bin/redis-cli renamed to test/bin/ghe-redis-cli

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ while true; do
1818
echo "fake redis data" > "$GHE_REMOTE_DATA_USER_DIR/redis/dump.rdb"
1919
break
2020
;;
21-
-h)
22-
# Fake accepting hostname argument
23-
shift 2
21+
--remote)
22+
# Fake accepting remote flag argument
23+
shift 3
2424
;;
2525
*)
26-
echo "unexpected redis-cli command: $1" 1>&2
26+
echo "unexpected ghe-redis-cli command: $1" 1>&2
2727
exit 1
2828
;;
2929
esac

0 commit comments

Comments
 (0)