Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mksysb script cron'd halts on dd

Status
Not open for further replies.
Sep 5, 2002
8
GB
We have a script that runs a mksysb and then a savevg on the remaining vg's. If it runs under cron or at
it hangs running dd ibs=1b obs=64b of=/tmp/tape.bootimage. However if I kill all the processes and run the same script manually, it goes through just fine. If I kill the above dd process the remainder of the script completes ok aswell.
Have tried re-creating the shell environment while running under cron to no avail.
Does anyone have any suggestions as to what might be causing this ? OS is AIX 433 ML8. Thanks in advance.

Here's the process listing at hang point:
root 22182 48834 0 18:04:40 - 0:00 ksh /usr/bin/mksysb -X -i -m /dev/rmt0.1
root 42512 625438 0 18:04:06 - 0:00 ksh
root 42806 54446 0 18:05:00 - 0:00 dd ibs=1b obs=64b of=/tmp/tape.bootimage
root 48834 1005524 0 18:04:06 - 0:00 ksh /usr/bin/mksysb -X -i -m /dev/rmt0.1
root 54446 48834 0 18:04:52 - 0:00 ksh /usr/sbin/bosboot -d/dev/rmt0.1 -a -k /usr/lib/boot/unix_mp
root 1005524 42512 0 18:04:06 - 0:00 ksh ./fullbackup.sh

and here's the script:

#!/bin/ksh
TAPE=/dev/rmt0.1
LOG=/tmp/fullbackup.log
mv $LOG $LOG.yesterday

tctl -f $TAPE rewind
# set >> $LOG
echo "Starting backup at `date`" >> $LOG

/usr/bin/mksysb -X -i -m $TAPE >> $LOG 2>&1

for i in `lsvg | grep -v rootvg`
do
/usr/bin/savevg -i -f $TAPE $i >> $LOG 2>&1
done
echo "Finished backup at `date`" >> $LOG
 
You mksysb isn't completed before the savevg starts. mksysb started at 18:04:40 and savevg started 20 seconds later at 18:05.

maybe putting a sleep command in between the mksysb and savevg commands would work, but I'm not sure about restoring with a mksysb and savevg on the same tape.
 
Bi,

Thanks for your reply. However, I don't think that this is what is happening. It looks like the dd is part of the mksysb and I have #'d out the commands after the mksysb in the script. It still hangs.

I am foxed.

Tom
 
hi ,

just a few thoughts

1. How long does the script run for ? depending on size of root e.g. we have rootvg 67000 files takes 10 mins

2. Have you tried running the command manually or via smitty
does this work ?

3. Are there any messages/ errors reported in mail ( run mailx) or error report regarding tape errors


HTH
 
Hello Dsmarway,

The whole thing (mksysb & savevg) takes just under 90 minutes.

Yes, it works ok manually and with nohup, but fails with cron and at.

No, there aren't any mail messages, errpt or syslog entries. It dies silently.

Tom
 
Have you set all the environment variables in the script that you have when you run the command from the command line (path, libraries, etc.)?
 
Sorry, I will not make the ting go forward, but:

bi: mksysb forks itself and keeps 2 processes running (at least). You can see in the above process list that one of the mksysb processes is the child of the another.

--Trifo
 
Yes, I have added . ~/.profile to the script and it still fails.
The box is due to go to AIX5 this month and I've run the script thru crontab ok on an AIX5 box. Seems a shame not to resolve it tho'.
 
People,

The solution to this problem was to restart crontab.
Many thanks for your time.

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top