Solved

tar remotely using ssh and directly transfer files into tape

Posted on 2001-08-24
9
900 Views
Last Modified: 2013-12-23
Hi,

I'm having trouble getting this to work. The local machine runs solaris and is the only one with a tape drive. i'm trying to archive files from other machines (running Linux) directly into the tape drive.

I tried commands like this:

Local> ssh user@remote "tar -cv /home/dir1" > /dev/rmt/0 dir1.tgz

and some combinations similarly but nothing gets into tape. It works if it is to a local directory though. I'll offer 200 points for this one, if anyone can help me out quickly.

Thanks,
KC
0
Comment
Question by:chenky
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 5

Expert Comment

by:ecw
ID: 6422641

$ ssh user@remote "tar -cf - /home/dir1" > /dev/rmt/0
0
 
LVL 40

Expert Comment

by:jlevie
ID: 6424238
The classic way to do this is to set the Solaris box up for rsh access for the appropriate users and to then do 'tar cf solaris-sys:/dev/rmt/0'. Of course there are security implications in doing that, but on a local LAN that is normally an acceptable compromise. For the really paranoid, having a 'tape only server' is an appropriate solution.
0
 

Author Comment

by:chenky
ID: 6427814
Thanks guys,

I tried those, seem to hangup - tape drive doesn't even blink, and it just seems to hang there.

KC
0
 
LVL 38

Expert Comment

by:yuzh
ID: 6427903
Hi  chenky,

    In your LAN, set up rsh to use the remote tape. I assume that you know how to set this up. ( edit /etc/hosts, .rhosts file etc).

   to verify rsh: at the client box:
   rsh server echo test
   if you see test echo on your screen, it is ok with rsh, make sure that you have write permission to write to the tape drive on the server, if not, you might have to do it as root.

    use the following command to copy the files to the tape on the server:
(do this at your work station)

    tar cf - /home/dir | rsh tape-server dd of=/dev/rmt/0n

    you can verify what's on the tape at the workstation or tape server.

    make sure you rewind the tape first.

    Cheers!

===========
yuzh
 
   

   

   
0
New! My Passport Wireless Pro Wi-Fi Mobile Storage

Portable wireless storage to offload, edit, and stream anywhere.

High-capacity, wireless mobile storage designed to accompany professional photographers and videographers in the field to easily offload, edit and stream captured photos and high-definition videos.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 6428005
>ssh user@remote "tar -cv /home/dir1" > /dev/rmt/0 dir1.tgz

What does  dir1.tgz  mean?

I suggest:
  ssh user@remote tar -cf - /home/dir1 | tar -xf /dev/rmt/0

(keep in mind that this device has a special block size, usualy, so the second tar probably should have an appropriate block size with the -b option)
0
 

Author Comment

by:chenky
ID: 6435812
Hi guys,

I prefer not to use rsh - security reasons - even on LAN. But thanks for the suggestions.

Hi ahoffmann,
Works better, but command line still hangs there without writing anything into tape. I've tried many other variations, including putting "" on "tar -cf - /home/dir1" as well as adding "-" after tar -xf. It should notify sending it to stdout and reading stdin within a created shell. Any ideas ?

Thanks,
Chenky
0
 
LVL 38

Accepted Solution

by:
yuzh earned 200 total points
ID: 6436120
Hi chenky,

   You can use ssh talk to the tape drive, but for some unknow reason, it cann't complete the tar process, that's
why you see the commanline hangs!

   May be you can try to use different blocking factors to see how it goes.

   use:ssh user@remote tar cfb 128 - /dirname | dd of=/dev/rmt/0n obs=128b

   
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6438320
> tar cfb 128 -
should be
  tar cbf 128 -

chenky, could you pleas check if following produces a valid tar file:

    ssh user@remote tar -cf - /home/dir1|tar -xf /tmp/t.tar
0
 

Author Comment

by:chenky
ID: 6438978
Hi Yuzh,

very close, this actually works....
ssh user@remote "tar cf - /dirname"| dd of=/dev/rmt/0 obs=126b

anyway I accept yours as an answer, Thank you and also the other guys too, saved me from a lot more headache.(been having lots!)

200 points is yours!

Thanks again,
Chenky
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SD - WAN 2 44
Auto Smartport macro for Dell and HP laptops 2 54
Installation of Nessus Professional 5 81
Network access 4 22
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
When it comes to security, there are always trade-offs between security and convenience/ease of administration. This article examines some of the main pros and cons of using key authentication vs password authentication for hosting an SFTP server.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now