1830438 Members
2246 Online
110004 Solutions
New Discussion

fbackup wierdness

 
NHL
Frequent Advisor

fbackup wierdness

Hi folks,

we have a script that backups up just 35G of data to a local DLT8000. This has been running fine for a while.

Now here's my problem -
fbackup runs a 23:40 via cron.

The first thing the script does is echo the date to a temporary file (start time).

The last thing the script does is echo the date to a different temporary file (finish time).

Oct 19 04:40 fbackup_start_time.txt
Oct 19 05:56 fbackup_finish_time.txt

cat fbackup_start_time.txt
Wed Oct 18 23:40:00 EDT 2006 : Fbackup started.

cat fbackup_finish_time.txt
Thu Oct 19 00:56:32 EDT 2006 : Fbackup finished.

What I don't understand is why the temp files don't get created until 5 hours after the call to create them.
It can be seen that the backup finished at 00:56 this morning, but the end of the script was not reached until 05:56, same 5 hour delay with the start.

Im unsure if the script is at fault (been working ok until recently) or it's an fbackup issue.

Below is our backup script.

Any help would be appreciated.
Nick .

# Script to backup to the DLT drive
#

#NHL ###
echo "`date` : Fbackup started." > /tmp/fbackup_start_time.txt
#########

# Which directory tree to backup
BACKUP_GRAPH_FILE=/var/adm/fbackupfiles/dlt2graph

# fbackup config file
CONFIG=/var/adm/fbackupfiles/config

# Index log file
INDEXLOG=/tmp/fbackup2dlt.index

# Backup device
BACKUPDEVICE=/dev/rmt/2m

# Log file
LOGFILE=/tmp/fbackup2dlt.log

# Problem warning file
ERRORFILE=/tmp/fbackup2dlt.err

# Backup OK file
BACKUPOK=/tmp/fbackup2dlt.ok

# Fatal error file
FATAL=/tmp/fbackup2dlt.fatal

rm -f $ERRORFILE $BACKUPOK $INDEXLOG $LOGFILE $FATAL > /dev/null 2>&1

# Start the backup and log all messages to one file
(
date
/usr/sbin/fbackup -f $BACKUPDEVICE -c $CONFIG -g $BACKUP_GRAPH_FILE -I $INDEXLOG
ERRORCODE=$?
if [ $ERRORCODE -eq 0 -o $ERRORCODE -eq 4 ]; then
date > $BACKUPOK
else
date > $ERRORFILE
echo "fbackup exited with error code $ERRORCODE" >> $ERRORFILE
fi
) > $LOGFILE 2>&1
if [ -f $FATAL ]; then
cat $FATAL >> $ERRORFILE
if [ $ERRORCODE -eq 0 ]; then
rm -f $BACKUPOK
ERRORCODE=1
fi
fi

# NHL ###
echo "`date` : Fbackup finished." > /tmp/fbackup_finish_time.txt
#########

exit $ERRORCODE



8 REPLIES 8
Peter Godron
Honored Contributor

Re: fbackup wierdness

Hi,
I would check your timezone settings.
When you cron a job only a minimum environment is supplied.
What happens if you run a cut-down backup from the command line ?
NHL
Frequent Advisor

Re: fbackup wierdness

Hi Peter,

I think your on the right track.
My $TZ is GMT0BST but when I look at /var/adm/cron/log it is using EDT !

Im unsure of how that's happened or how to fix it. The time on the server itself is fine and the value of $TZ is correct.

I've got a quick fbackup starting in a minute via cron so I'll see how that goes.

Do you think I need to place TZ in the backup script to fix the problem ?

Thanks,
Nick .

NHL
Frequent Advisor

Re: fbackup wierdness

Right I've got some results.

An fbackup from the command line = no probs.

Fbackup via cron:
I set a backup to start at 10.00 this morning - it did not start.
At 10:05 I changed the job to start at 05:10 and at 10.10 (real time) it started.

Cron is running 5 hours behind schedule, using EDT instead of BST. I have no idea whats caused this but could anyone help me to fix cron please ?

Many thanks,
Nick .
Peter Godron
Honored Contributor

Re: fbackup wierdness

Hi,
please check /etc/profile and ~/.profile of user you ran the test backup as.
Somewhere there should be a TZ variable set.
Otherwise try "env | grep -i TZ"
Include this value into your backup script via "export TZ=". Or include the /etc/TIMEZONE file.

NHL
Frequent Advisor

Re: fbackup wierdness

Hi Peter,

thanks very much for your advice.
Before amending the script to set TZ I decided to just restart cron ... and that fixed it. A quick backup ran at the correct time and /var/adm/cron/log is showing BST as it should.

Hopefully this is now resolved.

Thanks again for you help,
Nick .
BUPA IS
Respected Contributor

Re: fbackup wierdness

Nick,
Have a look at the kernel parameter timezone. The hp default is plus 420 which is eastern time 5 hours west of greenwich if you set this to 0 the the os will use UTC (GMT) as its fundemental timezone if you set dst to 3 rather than 1 then western european style is used for converting the display when the change over to summer time is made. These values are used by the os routines at start up because the full shell environment is not yet available to all of them .
Mike
Help is out there always!!!!!
NHL
Frequent Advisor

Re: fbackup wierdness

Thanks Mike. I'll have a look at that.

Nick .
NHL
Frequent Advisor

Re: fbackup wierdness

Cron daemon threw a fit somehow and thought it was running in EDT. Restartd cron - ok now.