- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: informix backup script help
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2007 07:20 PM
тАО01-25-2007 07:20 PM
I'm backing up my informix db to disk using the following script.
Since the backup file name has a static name in the onconfig file is there any way add a bit onto this script that will rename the backup file to the current date after the backup is finished?
Thanks
George
####################################################################
# script to backup Informix to disk
####################################################################
INFORMIXDIR=/opt/informix
export INFORMIXDIR
PATH=$INFORMIXDIR/bin:$PATH
export PATH
ONCONFIG=onconfig.svr2
export ONCONFIG
INFORMIXSERVER=svr2
#svr2 = pbs database
export INFORMIXSERVER
## Echo message to log file
echo "Archive Informix Online for $INFORMIXSERVER"
LEVEL=0
echo "$LEVEL"| ontape -s | head -100 > /tmp/ontapelogfile
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2007 07:27 PM
тАО01-25-2007 07:27 PM
Re: informix backup script help
TAPEDEV /infbackup/svr2backup.bak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2007 07:41 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2007 08:03 PM
тАО01-25-2007 08:03 PM
Re: informix backup script help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2007 08:21 PM
тАО01-25-2007 08:21 PM
Re: informix backup script help
although this is an old doc, you may find it useful :
http://www.oreilly.com/catalog/unixbr/chapter/ch14.html#83088
or for the whole chapter:
http://www.oreilly.com/catalog/unixbr/chapter/ch14.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2007 09:11 PM
тАО01-25-2007 09:11 PM
Re: informix backup script help
you should really check the return code from the ontape command, in order to see if the backup worked.
Because your ontape command is in the middle of a series of pipes, its hard to do this without checking the online log file using onstat -m. Grep -i 'aborted'.
Anyway, just add one of the mv commands specified above to the end of your script after the ontape line.
Also do a 2>&1 on the end of the ontape line, to capture any stderr messages.
You should also rename /tmp/ontapelogfile to have a datetimestamp on the end, giving historical record of the backup success/failure status.
Don't store the backup messages in /tmp in case of cleardowns, you would lose them.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-25-2007 09:52 PM
тАО01-25-2007 09:52 PM
Re: informix backup script help
> sort of signal to let it know the backup had
> finished or not before it renamed the file.
If the commands in the script are executed syncronous the execution of the next command
will only take place after the one before has finished execution.
However, if a predecessor process backgrounded the execution of pending commands will continue and not be blocked until the former's termination.
In such a case you can make use of the wait command.
Without arguments it will wait till all backgrounded process have finished.
But you can pass it the PID of a specific backgrounded process that the next command in the script should wait for.
The PID of the last backgrounded process is stored in the shell special variable $! for instance.
So you could add
wait $!
or better, if you have several backgrounded processes, store their PIDs in variables or an array immediately after they were backgrounded for later reference in various wait calls.