Hi MAL,

- snip -

What will be the command for another way round.

If, on MachineA, to tar a folder on MachineB, send the tarball via SSH to MachineA and untar it on select folder automatically.

Is it;
$ ssh -X [EMAIL PROTECTED]/path/to/folder | tar zcf "cd /user:MachineA/path/to/folder tar zxf"


Interesting guess, but far from correct.

-X is really irrelevant, as we're not doing anything X11 oriented.
ssh is simply being used to run a command (tar), on the remote machine. It will forward any output of the program we run, accross the network, to the local machine (so in this case, the output of tar).


So:

ssh [EMAIL PROTECTED] "cd /path/to/folder ; tar zc ." | tar zxx


It works, "zx" only. What is the function of "space" and "." after "tar zc"?

If I expect to untar the tarball to a selected folder, instead of changing to the folder first to issue the command, can following command do the job

$ ssh [EMAIL PROTECTED] "cd /path/to/folder(MachineB) ; tar zc ." | "cd /path/to/folder(MachineA) ; tar zx"

Thanks and B.R.
Stephen



Almost the exact opposite of the command to copy from local to remote. The | joins two commands, piping the output of one, to the input of another. ssh and tar happily send data to and from each other, with ssh acting as the go-between.

MAL





-- [EMAIL PROTECTED] mailing list



Reply via email to