- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: fbackup creating two index files
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
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
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
04-25-2014 12:16 AM
04-25-2014 12:16 AM
Hi,
I have a simple backup script using fbackup to read from a graph file. Each time I use a new tape, I notice that two index files are being created - the first one is empty, the second one (time stamped a minute after the first index file) is the correct file with a list of indexed files.
This is the backupscript I am using:
#!/usr/bin/sh
LOGFILE=/tmp/backupindex.`date +%Y-%m-%d-%H:%M`
LOGFILE1=/tmp/backuplog.`date +%Y-%m-%d-%H:%M`
TAPEDRIVE=/dev/rmt/0mn
#Rewind tape
mt -f $TAPEDRIVE rewind >> $LOGFILE
fbackup -0u -f $TAPEDRIVE -g /tmp/backupgraph -I /tmp/backupindex.`date +%Y-%m-%d-%H:%M` 2> /tmp/backuplog.`date +%Y-%m-%d-%H:%M`
mailx -s "Backup to Tape" admin@abc.com < $LOGFILE
mailx -s "Backup to Tape" admin@abc.com < $LOGFILE1
echo backup complete
Does anyone know why such behaviour?
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2014 06:33 AM
04-25-2014 06:33 AM
SolutionThe reason is that you are specifying an index file name in your 'fbackup' command line rather than using the $LOGFILE variable you have already defined, so you get different time stamps.
Here is what I would do:
#!/usr/bin/sh
LOGFILE=/tmp/backupindex.$(date +%Y-%m-%d-%H:%M)
LOGFILE1=/tmp/backuplog.$(date +%Y-%m-%d-%H:%M)
TAPEDRIVE=/dev/rmt/0mn
#Rewind tape
mt -f $TAPEDRIVE rewind >> ${LOGFILE1}
fbackup -0u -f $TAPEDRIVE -g /tmp/backupgraph -I ${LOGFILE} 2> ${LOGFILE1}
mailx -s "Backup to Tape" admin@abc.com < ${LOGFILE}
mailx -s "Backup to Tape" admin@abc.com < ${LOGFILE1}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2014 06:55 AM - edited 04-25-2014 06:57 AM
04-25-2014 06:55 AM - edited 04-25-2014 06:57 AM
Re: fbackup creating two index files
Hi Patrick,
I get that I am creating another file in the script.
But why is it creating two index files each time? I am only noticing this problem on Mondays, when I use a new tape media. On the remaining days, when I overwrite the tape, I get only one (correct) index file.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2014 07:15 AM - edited 04-25-2014 07:22 AM
04-25-2014 07:15 AM - edited 04-25-2014 07:22 AM
Re: fbackup creating two index files
With the script that you provided you will always get 2 /tmp/backupindex files created. The first will be created when you rewind the tape, which is probably the empty one you see. The second file will be created by the fbackup command itself and will be the one with all of your files in it.
First file created here:
LOGFILE=/tmp/backupindex.`date +%Y-%m-%d-%H:%M`
mt -f $TAPEDRIVE rewind >> $LOGFILE
Second file created here with the different time stamp:
fbackup -0u -f $TAPEDRIVE -g /tmp/backupgraph -I /tmp/backupindex.`date +%Y-%m-%d-%H:%M` 2> /tmp/backuplog.`date +%Y-%m-%d-%H:%M`
What may be occurring is that when you use a new piece of media, fbackup has to create the fbackup header on the tape. That takes a little bit of time. It may be that this amount of time is enough that the file specified on the fbackup command line will have a different time stamp.
Basically the scenario is this:
Previously used media:
mt command is run and creates /tmp/backupindex.2014-04-25-09:19, which is probably empty.
fbackup runs, doesn't have to do much with the tape header, and starts writing to the same file name.
New media:
mt command is run and creates /tmp/backupindex.2014-04-25-09:19, which is probably empty.
fbackups runs, sees that the media is new, does its thing with creating the fbackup header, and then starts backuping up. When it gets to the point of creating a new file it creates /tmp/backupindex.2014-04-25-09:20 because the additional tasks have taken more time.
If you use the $LOGFILE variable in the fbackup command line, this will no longer happen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2014 07:19 AM
04-25-2014 07:19 AM
Re: fbackup creating two index files
Actually no, I am only getting two LOGFILE (the index file) on Mondays when I use a new tape. Otherwise on the other days (Tuesday-Friday) I only get one index file. On all days I only get one backup log file (LOGFILE1).
Strange?? That is why I was thinking there is something wrong with backups on Mondays.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2014 07:23 AM
04-25-2014 07:23 AM
Re: fbackup creating two index files
Post above edited with a theory...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2014 07:30 AM
04-25-2014 07:30 AM
Re: fbackup creating two index files
Makes sense now. I'll try this and let you know.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2014 10:56 AM
04-25-2014 10:56 AM
Re: fbackup creating two index files
>specifying an index file name in your fbackup command line rather than using the $LOGFILE
Sure looks like it. But the script can be improved to make sure the timestamps for the two files are the same:
TS=$(date +%Y-%m-%d-%H:%M)
LOGFILE=/tmp/backupindex.$TS
LOGFILE1=/tmp/backuplog.$TS
And the two mail messages combined using a here doc:
mailx -s "Backup to Tape" admin@abc.com <<EOF
Index file
==========
$(< $LOGFILE)
Log file
========
$(< $LOGFILE1)
EOF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2014 02:43 AM
04-28-2014 02:43 AM
Re: fbackup creating two index files
So, changing the script did result in one backup index file. Thanks for pointing this out.
One more question, I am getting a "fbackup(3205): WARNING: unable to read a volume header " even when NOT using new tapes, but using tape with a fbackup already on them. Is such a warning message normal? What is strange that I am not getting a warning for every used tape.
Thanks,
Tiziana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2014 07:56 AM
04-28-2014 07:56 AM
Re: fbackup creating two index files
If fbackup cannot read a tape header on tapes that have already been used (only?) by fbackup, I would worry about the viability of the backups on those tapes.
Some tests I would do (all assume a tape drive of /dev/rmt/1mn -- use whatever is correct for you):
1) Make sure you can read the fbackup header:
# frecover -V /tmp/fbackup-tape-header.txt -f /dev/rmt/1m
2) Make sure you can read the fbackup file index:
# frecover -I /tmp/fbackup-tape-index.txt -f /dev/rmt/1m
3) Try to read all files from the tape (pretend to recover, but do not write any files to disk):
# frecover -rNvf /dev/rmt/1m
If none of the above work on a tape that was written by fbackup, then I would also check to make sure that you don't have another process (an Ignite make_tape_recovery or a tar of some sort) that is overwriting your fbackup after it has completed.