Stephen Liu wrote:
Hi Nate,

Of course he could have also just piped tar though ssh too... into a tar on the opposite side. This works fine to move a few files too.


Interesting ......

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"

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

thanks

B.R.
Stephen

MAL



-- [EMAIL PROTECTED] mailing list



Reply via email to