github/backup-utils — pull request #78 by walkeran (2014-11-13 17:32:36+00:00)
Title: Enable SSH BatchMode

Ran into a small snag earlier today where `ghe-backup` wasn't dumping out a valid tar archive for ssh-host-keys.tar. Turns out it's not a GHE problem, nor is it really a backup-utils problem -- more a problem with my ssh client setup -- but it could be easily mitigated in the ghe-backup project.

The underlying problem is that I have a LocalCommand set in my ssh client config, that (when BatchMode is disabled -- e.g. an interactive shell) it will dump out some extra control characters to set my terminal/screen session title based on the hostname of the remote host. The effect is some "invisible" text at the beginning of the output which you can see here:

Extra escaped characters surrounding hostname ( `ESC-K`github`ESC-\` ):
```
$ share/github-backup-utils/ghe-ssh github.mydomain.com -- 'echo' | hexdump -b
0000000 033 153 147 151 164 150 165 142 033 134 012
```

With 'BatchMode yes':
```
$ share/github-backup-utils/ghe-ssh github.mydomain.com -- 'echo' | hexdump -b
0000000 012
0000001
```

This was all easily worked around by adding the `-o 'BatchMode yes'` option to ghe-ssh. I toyed with passing that via $GHE_EXTRA_SSH_OPTS, but didn't have any luck, so decided to hardcode it instead. I can't imagine that the addition of this option would break anything, and there's a reasonable chance that it will save someone else a headache :smile: