Operating System - HP-UX
1831999 Members
3057 Online
110034 Solutions
New Discussion

Block count for scheduled SAM system backup...

 
MAD_2
Super Advisor

Block count for scheduled SAM system backup...

Is there a file that has the total block count of a scheduled sam system backup?

I looked at file /var/sam/log/br_index.full which contains individual file block counts, but I did not see a total at the end. Anyone knows if there is actually a log that tracks this information or do I have to create my own script based on what is in br_index.full to get that number?

Thanks,
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
7 REPLIES 7
James R. Ferguson
Acclaimed Contributor

Re: Block count for scheduled SAM system backup...

Hi:

I suspect you're running 10.20. With 11.x, 'fbackup' reports a total at it's completion.

Regards!

...JRF...
MAD_2
Super Advisor

Re: Block count for scheduled SAM system backup...

Actually, I want to be able to get this information for 10.2 and 11. However, I am mostly concerned on 11, I want to use the information for a script that will provide me with some basics about the backup (tape status & failures if they occur, start time, end time, block or Kbyte usage, etc.)

I did scheduled it through SAM so that it will send an email to me, but I have no idea of what information the email will contain because I have not ran it yet!

Oh, one more thing, I just realized the contents of /var/sam/log/br_index.full are in byte size and not blocks...
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
James R. Ferguson
Acclaimed Contributor

Re: Block count for scheduled SAM system backup...

Hi (again):

OK, I just checked a 10.20 and an 11.0 server of mine. On 11.x , if you arm the 'v'erbose option of 'fbackup' and collect it's output, you will see the *block* count associated with each file copied, and a total at the end. In fact, you will find a both a total read and a total write block count.

Unfortunately, on 10.20 these block counts are not included.

On either 10.x or 11.x, you get a beginning time for the backup and the total number of seconds for the run using the 'v'erbose mode.

Regards!

...JRF...
S.K. Chan
Honored Contributor

Re: Block count for scheduled SAM system backup...

The index file (br_index.full) produced everytime SAM runs fbackup does not have the total at the end of it. It is most likely that you would have to write a quick "post-execution" script to get the total everytime SAM completes its backup, either extracting it from br_index.full itself or ..

# fbackup -f /dev/rmt/0m -I /tmp/Index
# TOT=0
# for i in `cat /tmp/Index|awk '{print $1}'`
>do
>((TOT=$TOT+$i))
>done
# echo $TOT

The total will be in bytes. Just a thought...
MAD_2
Super Advisor

Re: Block count for scheduled SAM system backup...

Thanks James and S.K. What I did was use some input I found from previous forums and built a script that will get some of the information I need. Some commands such as the following helped me get what I wanted...

Kbyte count:
cat /var/sam/log/br_index.full | awk 'BEGIN {total=0} {total+=$1} END {printf("%.2f Kb|n", total/1024)}'

Block count:
cat /var/sam/log/br_index.full | awk 'BEGIN {total=0} {total+=$1} END {printf("%.0f Blocks|n", total/512)}'

Substitute the pipe (|) after Kb and Blocks with a backslash. Apparently, the backslash does not reflect on the forum messages (Let's see, here is one "\")
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
James R. Ferguson
Acclaimed Contributor

Re: Block count for scheduled SAM system backup...

Hi Adam:

One more thing you might find useful. If you look at '/var/adm/fbackupfiles/dates' you will see (for each backup type) a couplet of lines that looks like:

/var/adm/fbackupfiles/graphs/backup_full 0 1022976196 1022986513
STARTED: Sat Jun 1 20:03:16 2002 ENDED: Sat Jun 1 22:55:13 2002

Hence, from this, you have a record of the start and stop times, and if you subtract the raw timestamps (seconds since the Epoch) on the first line, you have the number of seconds for which the session ran.

In fact all the information you need for start, stop and elapsed time can be obtained from the first line. For instance, from the above actual data:

# echo "0d1022976196=Y"|adb

...yields: 2002 Jun 1 20:03:16

Regards!

...JRF...
Regards!

...JRF...

MAD_2
Super Advisor

Re: Block count for scheduled SAM system backup...

Thanks James, I obtained basically the same information from the last 4 lines of /var/sam/log/br_log. The last lines after completion of the backup look like:

Full backup started on : Sun Jun 2 13:23:00 EDT 2002 (Scheduled Backup)
{ fbackup -0 -u -g /etc/sam/br/graphBDAa11065 -I /var/sam/log/br_index.full -
c /etc/sam/br/fbackup_config -d /var/adm/fbackupfiles/dates -f /dev/rmt/1m } 2>&1
Full backup completed with warnings on : Sun Jun 2 14:05:19 EDT 2002 .
Exit code = 4
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with