Operating System - HP-UX
1834142 Members
2294 Online
110064 Solutions
New Discussion

remote backups using tar in shell script

 
Amir Fadaghi
Advisor

remote backups using tar in shell script

Hello All;

I have 2 hp servers, one with tape drive and one with a bad tape drive (support has expired). I have to use tar to do the backup. When I use the following command

tar cvf - /home | remsh rmt_host dd of=/dev/rmt/0m
it works. If I put this command in a shell script i get the
tape not loaded error.

I think it is looking locally for the tape. How can I make it in the shell script to look at the remote host for the tape drive? I have .rhost file fine.

I thank you all for taking the time to respond
reach and touch someone
6 REPLIES 6
S.K. Chan
Honored Contributor

Re: remote backups using tar in shell script

The command that I'm using which works for me ..

# tar cvf - /home | remsh rmt_host "cat - | dd of=/dev/rmt/0m bs=10k"
harry d brown jr
Honored Contributor

Re: remote backups using tar in shell script

Save yourself a lot of headaches, and download Gnu's tar from the HP porting site:

http://hpux.cs.utah.edu/hppd/hpux/Gnu/tar-1.13.25/

it allows you to not only save files > 2gb, but also allows you to write to remote tape drives.

live free or die
harry
Live Free or Die
Kenny Chau
Trusted Contributor

Re: remote backups using tar in shell script

Well, what shell have you defined in your shell script? sh or ksh or others? If not, try to define the sh or ksh in your script at the top by #!/usr/bin/ksh or #!/usr/bin/sh

On the other hand, try to add -n option in the remsh, ie.

tar cvf - /home | remsh rmt_host -n dd of=/dev/rmt/0m

to see if it works.

Hope this helps.
Kenny.
Kenny
Animesh Chakraborty
Honored Contributor

Re: remote backups using tar in shell script

Hi Harry,
I was trying to install GNU tar but is says
dependecies not found.
Any idea?



* Target: ctxdbdr:/
* Target logfile: ctxdbdr:/var/adm/sw/swagent.log
* Reading source for product information.
* Reading source for file information.
The corequisite "gettext.gettext-RUN" for fileset
"tar.tar-RUN,r=1.13.25" cannot be successfully resolved.
The corequisite "libiconv.libiconv-RUN" for fileset
"tar.tar-RUN,r=1.13.25" cannot be successfully resolved.
: The dependencies for fileset "tar.tar-RUN,r=1.13.25" cannot be
resolved (see previous lines).
You must resolve the above dependencies before operating on
this fileset or change the "enforce_dependencies" option to
"false".
Did you take a backup?
Robin Wakefield
Honored Contributor

Re: remote backups using tar in shell script

Hi,

Both these dependencies may be found at the porting sites, e.g.:

http://hpux.connect.org.uk

They are listed as dependencies on the Gnu-tar download page.

Rgds, Robin.
Amir Fadaghi
Advisor

Re: remote backups using tar in shell script

All thank you very much for help for giving me ideas. Since, the project is not due until 2 months I think I will wait till the owner wants to deal with this issue more constructively.
reach and touch someone