Operating System - HP-UX
1834485 Members
3146 Online
110067 Solutions
New Discussion

Re: Using tar with remote shell

 
SOLVED
Go to solution
Frank de Vries
Respected Contributor

Using tar with remote shell

I din't bring my unix powertools book ,
and I am trying to do something from head,
but seems my memory is degrading already :)

I am trying to tar a complete dir and subdir
structure with files and untar it at the other
end on an other server.

[root@oradb1:]/home/opera<>>> tar -cvf - . | remsh orasrv2 "tar -xvf /devnew/apps/opera"
a ./.cshrc 2 blocks
a ./.exrc 1 blocks
a ./.login 1 blocks
a ./.profile 4 blocks
a ./.dtprofile 8 blocks
a ./.kshrc 2 blocks
a ./.sh_history 8 blocks
tar: usage tar [-]{txruc}[eONvVwAfba ./report/bedarf.cerr 0 blocks
a ./report/ftp_on_050410.log 26 blocks
lhm{op}][0-7[lmh]] [tapefile] [blocksize] file1 file2...
[root@oradb1:]/home/opera<>>>

Anyone remember the correct syntax.
Thanks
Look before you leap
3 REPLIES 3
RAC_1
Honored Contributor

Re: Using tar with remote shell

Write a `tar' tape on a remote computer that owns a DAT/DDS drive.

cd /relative_path

tar cvf - . | remsh name -l user "cat - | dd of=/dev/rmt/0m bs=10k"

Restore a `tar' tape from a remote computer that owns a DAT/DDS drive.

cd /relative_path

remsh name -l user dd if=/dev/rmt/0m bs=10k | tar xvf -
There is no substitute to HARDWORK
Ralph Grothe
Honored Contributor
Solution

Re: Using tar with remote shell

Try

cd ~opera
tar cf - .|remsh orasrv2 'cd /devnew/apps/opera && tar xf -'

But I would rather chose either GNU tar
or find & cpio or vxdump && vxrestore
Madness, thy name is system administration
Frank de Vries
Respected Contributor

Re: Using tar with remote shell

Thanks,
Look before you leap