Skip to content

Commit e828772

Browse files
committed
report mysqldump failures
1 parent 5717ca3 commit e828772

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bin/ghe-backup

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ ghe-ssh "$GHE_HOSTNAME" -- 'ghe-export-ssh-host-keys' > ssh-host-keys.tar ||
100100
failures="$failures ssh-host-keys"
101101

102102
echo "Backing up MySQL database ..."
103-
echo 'ghe-export-mysql | gzip' |
104-
ghe-ssh "$GHE_HOSTNAME" -- /bin/sh > mysql.sql.gz ||
103+
echo 'set -o pipefail; ghe-export-mysql | gzip' |
104+
ghe-ssh "$GHE_HOSTNAME" -- /bin/bash > mysql.sql.gz ||
105105
failures="$failures mysql"
106106

107107
echo "Backing up Redis database ..."

share/github-backup-utils/ghe-ssh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#/ Usage: ghe-ssh [<option>...] <host> [<simple-command>...]
3-
#/ echo <complex-command>... | ghe-ssh [<option>...] <host> /bin/sh
3+
#/ echo 'set -o pipefail; <complex-command>...' | ghe-ssh [<option>...] <host> /bin/bash
44
#/ Helper to ssh into a GitHub instance with the right user and port. The first
55
#/ form should be used for simple commands; the second form should be used for
66
#/ complex commands that include pipelines or multiple commands.
@@ -51,7 +51,7 @@ opts="-l $user $opts"
5151

5252
# Bail out with error if the simple command form is used with complex commands.
5353
# Complex
54-
if echo "$*" | grep "[|;]" >/dev/null || [ $(echo "$*" | wc -l) -gt 1 ]; then
54+
if echo "$*" | grep -q "[|;]" || [ $(echo "$*" | wc -l) -gt 1 ]; then
5555
echo "fatal: ghe-ssh: Attempt to invoke complex command with simple command form." 1>&2
5656
echo "See ghe-ssh --help for more on correcting." 1>&2
5757
exit 1

0 commit comments

Comments
 (0)