On Thu, 14 Dec 2000, Dan wrote:

> Ok, this is driving me crazy, I want to tar a bunch of dirs/files/etc and
> port it through ssh on linux.
>
> I tried tar -cvf - | ssh [EMAIL PROTECTED]
>
> and it doesn't work
>
> I tried the above with "dd of=/home/user/backup"
> and it doesn't work.
>
> tar -cvf -
> doesn't seem to work at all, linux 2.2.17
> tar -cvf * or . first command doesn't work,
> second command creates a file called "backup" which is just a directory
> list of all the files. useless!
>
> this should be simple, but I can't get it working.
>
> all I want is to have the tar file exist on the remote box.
>


Hi Dan,

        "tar -cvf -"  should give an error something like...

tar: Cowardly refusing to create an empty archive

.... which might be part of your problem.  But you need to tell the other
end of the ssh connection to do something with the data your sending it.  I
I think you were probably on the right track with dd.  Try...

tar -cpf - <list of files> | ssh [EMAIL PROTECTED] dd of=backup.tar

... and you should wind up with a tar ball in ~user/backup.tar on the remote
box that contains the same files from the list you started with.  Using some
time files I had hanging around...

[mloe@knabrevir /tmp]$ ls Acro*
AcroBf5Bt7  AcroDp9KY8  AcroOuKzpZ  Acroaepu1M  AcropfMwil
[mloe@knabrevir /tmp]$ tar -cpf - Acro* | ssh mloe@wildwoods dd of=acros.tar
19+2 records in
20+0 records out
[mloe@knabrevir /tmp]$ ssh mloe@wildwoods
Last login: Fri Dec 15 18:41:33 from knabrevir
[mloe@wildwoods mloe]$ ls -l acros.tar
-rw-r--r--    1 mloe     mloe        10240 Dec 15 18:47 acros.tar
[mloe@wildwoods mloe]$ tar -tvf acros.tar
-rw-rw-r-- mloe/mloe         0 2000-12-09 01:46:29 AcroBf5Bt7
-rw-rw-r-- mloe/mloe         0 2000-12-08 18:24:17 AcroDp9KY8
-rw-rw-r-- mloe/mloe         0 2000-12-08 18:24:22 AcroOuKzpZ
-rw-rw-r-- mloe/mloe         0 2000-12-08 18:24:19 Acroaepu1M
-rw-rw-r-- mloe/mloe         0 2000-12-08 18:24:23 AcropfMwil
[mloe@wildwoods mloe]$ tar -xvf acros.tar
AcroBf5Bt7
AcroDp9KY8
AcroOuKzpZ
Acroaepu1M
AcropfMwil
[mloe@wildwoods mloe]$ ls Acro*
AcroBf5Bt7  AcroDp9KY8  AcroOuKzpZ  Acroaepu1M  AcropfMwil
[mloe@wildwoods mloe]$

... hmm.. i guess it would have been better if used some non-zero sized
files but you get the idea. :)

M.

-- 
WebCentral Pty Ltd           Australia's #1 Internet Web Hosting Company
Level 1, 96 Lytton Road.           Network Operations - Systems Engineer
PO Box 4169, East Brisbane.                       phone: +61 7 3249 2583
Queensland, Australia.                            pgp key id: 0x900E515F

Reply via email to