Ssh to get files from server A and zip in server B

Hi,

I have read & write access in Unix box A and read access in Unix box B.
I want a folder to be zipped from box B and sftp-ed in box A.

Is there a remote scripting to achieve this?

Yes, there is: you can use the "ssh" command to execute commands remotely:

userA@hostA> ssh userB@hostB "some-command"

willl, when issued as userA on hostA, run "some-command" on hostB as userB. You might want to use "scp" instead of "sftp", but that is rather a matter of taste.

I hope this helps.

bakunin

ssh me@boxB ' tar cf -  ./some/directory | ssh me@boxA ' | cat - | zip ./mytar.tar.zip -) '

IF you do not have ssh keys this will ask for passwords: once for boxB then again for boxA