[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Preferred Backup Method?




On Dec 7, 2007, at 8:02 PM, cls@truffula.sj.ca.us wrote:

[This message has also been posted to linux.debian.user.]
 On Wed, Dec 05, 2007 at 03:35:46PM -0800, David Brodbeck wrote:
You're close.  Try this:

tar cvvf - bar | ssh -e none user@dest "cat >foo.tar"

Using - as the filename tells tar to output to stdout. "-e none" disables SSH's escape character, making the session fully transparent -- otherwise SSH will go into command mode if your tar output happens to contain a line
that starts with ~.

	What?  I've moved many gigabytes through
	  tar cf - stuff | ssh remotebox tar xf -
	If there were a problem with tilde dot in the stream I would
	have seen it by now.  Let's try an experiment with
	Debian boxes truffula (local) and oobleck (remote).

...

	So "ssh host" cares about ~. but "ssh host command" doesn't.
	No wonder I've been getting away with tar | ssh tar.
	The "-e none" is not necessary.



Hmm, it would seem you're right.

I was going by the ssh manpage, which says:

     -e escape_char
Sets the escape character for sessions with a pty (default: `~'). The escape character is only recognized at the beginning of a line. The escape character followed by a dot (`.') closes the connection; followed by control-Z suspends the connection; and followed by itself sends the escape character once. Setting the character to ``none'' disables any escapes and makes the session
             fully transparent.


What I didn't pay attention to was the phrase "for sessions with a pty." It would seem when you call ssh with a command, it doesn't allocate a pty by default, so the escape character is not honored. Good to know.



Reply to: