Operating System - HP-UX
1830940 Members
1932 Online
110017 Solutions
New Discussion

fbackup error output file

 
Kelvin Yu
Advisor

fbackup error output file

Hi,

I am doing a cron fbackup on to the tape and are wondering where this cron fbackup error output file located. Can I specify this error log manually? Thanks so much.

Regards,
Kelvin
14 REPLIES 14
Ken Hubnik_2
Honored Contributor

Re: fbackup error output file

On your crontab entry just redirect standard error to a file. 2> /tmp/error.log
Kelvin Yu
Advisor

Re: fbackup error output file

Thanks for the reply.

Since this is a cron job, in case of error occurs while backing up, how can I respond to the request that might arise, such as "would you like to enter a new output file?". In our situation, if there are problems during backing up, the normal step is to exiting out and let me check that out later.

How can I go about to do that? Thanks.

Regards,
Kelvin
Zigor Buruaga
Esteemed Contributor

Re: fbackup error output file

Hi,

Check this link:
http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F1%2C%2C0x3a1272106351d5118fef0090279cd0f9%2C00.html&admit=716493758+1064584447627+28353475
As suggested by Sachin Patel, you could try to run "mt" command before the backup, for testing purposes. If all OK, then you can follow with the backup.
Hope this helps.
Kind regards,
Zigor
Kelvin Yu
Advisor

Re: fbackup error output file

Thanks for the reply.

I did "mt" before I start the fbackup. What I mean is error occurs while backing up.

Regards,
Kelvin
Zigor Buruaga
Esteemed Contributor

Re: fbackup error output file

Hi again,

And what are the previous error messages before "would you like to enter a new output file"?
Have you tried to clean the drive, or use other tape?

Kind regards,
Zigor
Jose Mosquera
Honored Contributor

Re: fbackup error output file

Hi,

By default all cron event are sending at cron owner mailbox, where you can find a detail of the command execution. Also you can redirect the command output into your cron definition:

30 9 * * * /PATH/your_scrip.sh 2> /PATH/debug.log

or keep both of them (mail and debug file):

30 9 * * * /PATH/your_scrip.sh 2>&1|tee -a /PATH/debug.log

Rgds.
Jon Mattatall
Esteemed Contributor

Re: fbackup error output file

Check /var/adm/cron/log.
* * * * * /usr/sbin/fbackup -options > /path/to/logfile (/tmp/fbackuplog, or whatever suits you) 2>&1 will redirect all messages to the logfile.

But if you don't have one specified, check /var/adm/cron/log.
A little knowledge is dangerous - none is absolutely terrifying!!!
Kelvin Yu
Advisor

Re: fbackup error output file

Hi,

Thanks for all the reply.

I have re-directed the output & error to a log file. However, while the fbackup is running, there is problem on the tape and the system will ask for "would you like to enter a new output file?". Since this is a cron job, I would not be able to respond interactively. Now, how can I respond to this question? Since there is an error, I normally want to exit and let me check that out later.

Regards,
Kelvin
Zigor Buruaga
Esteemed Contributor

Re: fbackup error output file

Hi again,

I think that your best option here is to solve the problem that generates the message ""would you like to enter a new output file?".
But now I'm not sure if I understand your question correctly. You don't want to respond automatically to that question, since you don't know the problem that has caused it.
So, you only want to exit at the precise moment of the error and check that out later, with something like an script "tailing" the errorlog and aborting the fbackup when that message appears?
Or probably I'm absolutely wrong ...

Anyway, could you please post all the error log?
Kind regards,
Zigor
Bill Hassell
Honored Contributor

Re: fbackup error output file

I tink what you mean is that fbackup may run out of tape and pauses to ask for another tape. This is how the chgvol option works. Always specify a configuration file as the default parameters are designed for (very old) reel-to-reel drives, and specify a script to run when fbackup runs out of tape. This script would have to alert the operator to insert a new tape, then acknowledge the tape change to the script which then starts fbackup to continue. Since it is doubtful that an operator would simply stare at a console all night, the script will have to reach a signalling device, perhaps a pager or cellphone with text capability. Signalling the script can be done with traps and user signals.


Bill Hassell, sysadmin
Steve Horvat
New Member

Re: fbackup error output file

Will fbackup automatically resume after the script is notified that a tape has been inserted or is there a command that must be issued?

In other words, if the script is looking for a tape_is_ready file that the operator creates with another script once a new tape is inserted. Do I need to issue a command for fbackup to resume other than an exit 0 to get out of the chgvol script?
Bill Hassell
Honored Contributor

Re: fbackup error output file

> Will fbackup automatically resume after the script is notified that a tape has been inserted or is there a command that must be issued?

Yes, fbackup calls the chgvol sript. What happens inside that script is what you will define. An exit 0 tells fbackup to continue.

> Do I need to issue a command for fbackup to resume other than an exit 0 to get out of the chgvol script?

No. However, be very careful to test the chgvol script using the batch command to emulate cron. Asume the very worst: the operator will popout the current tape and then put in a write-protected tape. Test the status of the new tape (mt ... status). The operator will also put the same tape back in again. But by design, fbackup looks at the header on the tape and will discover it is a previous tape in this set. fbackup will issue an error message and run your chgvol script again.


Bill Hassell, sysadmin
Steve Horvat
New Member

Re: fbackup error output file

Bill,

Thank you for responding. My most recent log looks like this:
Output from fbackup:

br_backup: Invoking fbackup. See /var/sam/log/br_log for details.
fbackup(1004): session begins on Thu Jun 19 09:10:02 2008
fbackup(1517): /net not backed up - 'n' option (NFS) not specified
fbackup(3203): volume 1 has been used 12 time(s)
fbackup(3024): writing volume 1 to the output file /dev/rmt/1m
fbackup(3009): WARNING: File number 50389 (/ora2/prtlprod/data/undotbs_01.dbf)
was not successfully backed up
fbackup(3009): WARNING: File number 50403 (/ora2/prtprod/data/prodphy_d_d03.dbf)
was not successfully backed up
fbackup(3009): WARNING: File number 50404 (/ora2/prtprod/data/rbs_01.dbf)
was not successfully backed up
fbackup(3009): WARNING: File number 50466 (/ora3/prtprod/data/system_02.dbf)
was not successfully backed up
fbackup(3003): normal EOT
fbackup(3316): enter '^[yY]' when volume 2 is ready on /dev/rmt/1m,
or '^[nN]' to discontinue:
fbackup(3004): writer aborting
fbackup(1002): Backup did not complete : Reader or Writer process exit


My chgvol script kicks in at fbackup(3003). The operator inserts the next tape and I checked status using st -f /dev/rmt/1m -s
returning "Device is OK and available".

I ran the script that touches the tape_is_ready file. The chgvol script sees this and executes an exit 0. Shortly after I get the (3316) prompt and remaining messages dumped to the log. Do I need another parameter in my fbackup command such as -y ? Will including -y trump the chgvol script?
Bill Hassell
Honored Contributor

Re: fbackup error output file

It looks like you are using SAM:

> br_backup:

You will need a config file which normally isn't an option in SAM. Here is a typical config file:

blocksperrecord 4096
records 64
checkpointfreq 4096
readerprocesses 6
maxretries 5
retrylimit 5000000
maxvoluses 200
filesperfsm 2000
chgvol /full/path/to/chgvol.sh

Be sure to use a fullpath to the script and make sure it is executable by the user running fbackup. Make sure the script returns a zero return code (exit 0). Also, make sure you use the values above -- you'll get at from 30% to 200% improvement in speed.

Your chgvol script will have to monitor the tape status because it is run as soon as the tape starts to rewind. So it will take a while before the tape is ready to be ejected. Then monitor the tape to see when the new one is ready. Once true, use exit 0


Bill Hassell, sysadmin