Operating System - HP-UX
1835240 Members
2330 Online
110078 Solutions
New Discussion

Re: Problem with remote backup

 
James Phillips
Occasional Contributor

Problem with remote backup

Hi,

I'm getting the following error with I use the following script:

Tar: end of tape
Tar: to continue, enter device/file name when ready or null string to quit.

This is the script I'm using:

----------Begin---------
#!/bin/sh

MAILBODY=/tmp/body

/usr/bin/date > $MAILBODY

/usr/bin/ftp -i -n ftphost << EOF >> $MAILBODY 2>>$MAILBODY
user anonymous pass anon
bin
put "| tar cvf - `find /d00 -name '*.Z'`" d00.tar
EOF

/usr/bin/cat $MAILBODY | /usr/bin/mailx -s "PRD Daily Backup" sysadmin@oag-bvg.gc.ca

---------END-----------

Does anyone know how to fix it?

The commands in the script work interactively.
They fail when within the script however.

James Phillips
phillijs@oag-bvg.gc.ca
8 REPLIES 8
Ted Ellis_2
Honored Contributor

Re: Problem with remote backup

that is the normal message tar sends when it senses the end of the tape you are writing to and request another. Since you are likely running our of room on the tape, it would be tough to script something to handle this with a single tape drive... any chance you can use either a different device with larger tape, or in the case of a DAT drive maybe go for a higher capacity DAT tape... assuming the drive will cope with it...

what is the size of the archive and the capacity of the tape / tape drive?

Ted
Ted Ellis_2
Honored Contributor

Re: Problem with remote backup

oops.. that first reply is likely off target. Sorry.

looking at it again...
Sandip Ghosh
Honored Contributor

Re: Problem with remote backup

May be I am wrong, do you need to give "cvf" as the tar option? Because if you give "f" you have to specify the device file name.
If you want to do the tar on the file then I think you do not need the "-" sign after the cvf.

Sandip
Good Luck!!!
James Phillips
Occasional Contributor

Re: Problem with remote backup



The "-" is provided to send the tar to stdout.

The output is piped to 'put' and d00.tar is the name of the remote file.

When I run this script from the prompt it works. However, it doesn't work when launched from cron.

Any help/advice would be greatly appreciated.
Ted Ellis_2
Honored Contributor

Re: Problem with remote backup

what is your cron entry?
James Phillips
Occasional Contributor

Re: Problem with remote backup

Sorry, I shouldn't have said 'cron'.

I haven't got that far. At the unix prompt, when I run the script it doesn't work. However, when I cut and paste line by line the commands into a shell, it works.

Could it be because of terminal settings?

Ted Ellis_2
Honored Contributor

Re: Problem with remote backup

I have been able to reproduce your error on my server... interestingly it seems to depend on what you are trying to find. Example...

put "|tar cvf - `find /etc -name hosts`" d00.tar

fails with your error

if I change the directory to say /tmp and pick a different file, the script works. If I execute the job line by line on the command line, it also works. I don't have a solid answer yet, but it looks to be user/permission based?

Ted
Ted Ellis_2
Honored Contributor

Re: Problem with remote backup

still scratching my head on how this is working... or not working. In the earlier example attempting to run your code and use /etc/hosts fails. If I copy the hosts file to /tmp and then shift the script to run the find from the directory with everything else the same (except my user now owns the hosts file in /tmp), your code works. Can you verify the ownership and permissions of what you are working in and maybe make some changes that will get this to work. Again... I really don't know why this will not work. You may want to close this thread and repost with an update to suck in some fresh attention

Ted