Hi MAL,

Thanks for your advice.

- snip -

Is it;
On MachineA

tar zcvf folderToBeTared.tar.gz [EMAIL PROTECTED]/home/user/download/folderToBeTared


No, SSH takes anything passed to stdin, and outputs it to stdout on the other end, so:

tar zcv folderToBeTarred | ssh [EMAIL PROTECTED] "cd /dir ; tar zxv"

It works.


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"


Will it tar the full path? If I only want to tar a selected path say. "/user/download/folderToBeTared the what shall be the syntax?

man tar

tar will store paths relative from where you run it.

So if you wanted to tar only /usr/download/folderToBeTared but keep the full path, you'd do:

cd /
tar zcvf /tmp/folderToBeTared.tar.gz user/download/folderToBeTared

Or if you only wanted the content of the directory:

cd /user/download/FolderToBeTared
tar zcvf /tmp/folderToBeTared.tar.gz .

Or just keep the top folder in the archive:

cd /user/download
tar zcvf /tmp/folderToBeTared.tar.gz folderToBeTared

That is what I am doing now, changing to the top folder of the path to be tarred. I am looking for whether there is shortcut.


Thanks

B.R.
Stephen


-- [EMAIL PROTECTED] mailing list



Reply via email to