1831695 Members
2200 Online
110029 Solutions
New Discussion

fbackup - exit code 4

 
Mark Perry_1
Occasional Contributor

fbackup - exit code 4

Hi All,

I am having trouble running the following command:

fbackup -f /dev/rmt/1mnb -c fbackup.config -v -g fbackup.graph 2> /tmp/list

This returns an exit code of 4.

I get the following output:

fbackup(1417): cannot open the dates file /var/adm/fbackupfiles/dates for reading
fbackup(1004): session begins on Tue Jul 16 21:01:47 2002
fbackup(3203): volume 1 has been used 1 time(s)
fbackup(3024): writing volume 1 to the output file /dev/rmt/1mnb
1: ./ 2
2: ./.q4rc.pl 9
3: ./.secure 1
.
.
.
144430: ./var/yp/ypxfr_1perhour 1
144431: ./var/yp/ypxfr_2perday 1
fbackup(1005): run time: 3750 seconds
fbackup(1030): warnings encountered during backup
fbackup(3055): total file blocks read for backup: 74533179
fbackup(3056): total blocks written to output file /dev/rmt/1mnb: 75044946

Q - Is it because fbackup can't open the /var/adm/fbackupfiles/dates file that is causing the exit code of 4?
Q2 - Why is fbackup trying to open this file when I'm not doing an incremental backup?
Q3 - How should I ensure that I get an exit code of 0?


6 REPLIES 6
Steve Steel
Honored Contributor

Re: fbackup - exit code 4

Hi

fbackup has the following exit codes:

1. A warning return value is introduced to notice
the operator that fbackup ends with the warnings.
The following explanations can be found in fbackup(1M)
man page:
fbackup returns one of the following values:
0 upon normal completion.
1 if it is interrupted but allowed to save its state
for possible restart.
2 if any error conditions prevent the session from
completing.
4 if any warning conditions are encountered.


thus cannot open file = 4

test it or make sure it doe snot happen

Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Chris Wilshaw
Honored Contributor

Re: fbackup - exit code 4

The exit code 4 is commonly produced by any file which is active at the time of the backup, or a temporary file, which is removed from the system during the course of the backup (eg: a print request).

The easiest way to prevent getting the exit code 4 is to exclude the directory concerned from the backup scope

i.e.

add the line below to your fbackup.graph file

e /var/adm/fbackupfiles

Steve Steel
Honored Contributor

Re: fbackup - exit code 4

Hi

Since this can always happen when you backup an active system check for 1 or 4 as result ok.


Ex

#!/bin/ksh
typeset -i a=$1
if [ "$a" -eq "1" ] || [ "$a" -eq "4" ]
then
echo ok
else
echo $a received
fi


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Paula J Frazer-Campbell
Honored Contributor

Re: fbackup - exit code 4

Hi

From Man Fbackup:-

If fbackup is used for incremental backups, a database of past backups
must be kept. fbackup maintains this data in the text file
/var/adm/fbackupfiles/dates, by default. Note that the directory
/var/adm/fbackupfiles must be created prior to the first time fbackup
is used for incremental backups.

I would suggest that the file :-
/var/adm/fbackupfiles/dates

Should exit even though you are not doing and incremental backup.


Paula
If you can spell SysAdmin then you is one - anon
Paula J Frazer-Campbell
Honored Contributor

Re: fbackup - exit code 4

That should be:-

"should exist"

Paula
If you can spell SysAdmin then you is one - anon
James R. Ferguson
Acclaimed Contributor

Re: fbackup - exit code 4

Hi Mark:

'fbackup' returns an exit value of <4> for *any* warning. Usually, the warnings are for files that are changing while 'fbackup' is attempting to copy a static imsage to tape. (Of cource, the 'maxtretries' configuration file parameter accomodates how to handle this).

With regard to 'var/adm/fbackupfiles/dates', 'fbackup' *always* writes to this. The graph file's name and the beginning and ending date (in epoch seconds and in human-readable date form) are written into this file. Reuse of a graph file, simply overwrites the previous entry.

Regards!

...JRF...