[Veritas-bu] Script(s) needed for amount backed up and
2006-07-27 10:25:59
Subject: |
[Veritas-bu] Script(s) needed for amount backed up and |
From: |
Garrett.Covington at trizetto.com (Covington, Garrett) |
Date: |
Thu, 27 Jul 2006 08:25:59 -0600 |
Here is a script I wrote that calculates up the total data backed up per
policy. You should be able to edit it for specific clients instead of
specific policies (or all policies, as I use it most - for weekly stats)
Does not calculate speeds...
PS - watch for line wraps...
You should change the active bpimagelist to include '-client
client_name'
--
#!/bin/ksh
#
#***********************************************************************
*******
#
# Program : metrics.ksh
#
# Author : Garrett Covington
#
# Location: /usr/local/adm/netbackup/bin
#
# Function: This script runs bpimagelist command on any specified date
and sum
# up 'Total Number of Files' , 'Total Size of Kilobytes' and
'Total backup jobs'.
#
# Last Edited by: Garrett Covington 3/23/06
#
#
#***********************************************************************
*******
#bpimagelist =/usr/openv/netbackup/bin/admincmd/bpimagelist
DATE=`date '+%m-%d-%y'`
#echo $DATE
## Step 1: create bpimagelist file
#/opt/openv/netbackup/bin/admincmd/bpimagelist -U -d 03/06/2006 00:00:00
-e 03/06/2006 23:59:59 >/tmp/bpimagelist.out
## Daily Backups - only cumulative incrementals (CINC)
#/usr/openv/netbackup/bin/admincmd/bpimagelist -U -st CINC -hoursago 24
>/tmp/bpimagelist.out
## Weekly Full Backups - in metrics_weekly.ksh!!!
# 24 * 7 = 168hrs
# Run Weekly Wednesday morning at ~9am to capture last week of FULL
backups
#/usr/openv/netbackup/bin/admincmd/bpimagelist -U -st FULL -hoursago 168
> /tmp/bpimagelist.out
##Below is the active bpimagelist command
/usr/openv/netbackup/bin/admincmd/bpimagelist -U -hoursago 168 >
/tmp/bpimagelist.out
#bpimagelist -U -policy RMAN_Unix -d 7/21/2004 23:10:00 -e 7/22/2004
20:00:00 >/tmp/bpimagelist.out
#bpimagelist -U -d 20/31/2004 >/tmp/bpimagelist.out
## Step 2: awk using ' expressions ' through each line of
bpimagelist.out
#/usr/xpg4/bin/awk -f /export/home/covington/total_files_TB
/tmp/bpimagelist.out >/tmp/metrics.out
## note: the -f above is used to source total_files_TB which contained
the code between the ' ' bel
ow
/usr/xpg4/bin/awk '
BEGIN {OFS = " "
total_files = 0
total_size = 0
total_jobs = 0 }
{
total_files = total_files + $4
total_size = total_size + $5
total_jobs = total_jobs + 1
}
END {
print "Daily Incremental Backup Information "
print " Past 24 hours(6am-6am) "
print " total number of files = " total_files
print " total size in KiloBytes = " total_size
print " total size in TeraBytes = "
(total_size/1024/1024/1024)
print " total jobs = " total_jobs
}
' /tmp/bpimagelist.out >/tmp/metrics.out
cat /tmp/metrics.out
#Send Email about stats...
#mailx -s "GWV NetBackup Daily Metrics ($DATE)" < /tmp/metrics.out
email.address at test.com
Thanks,
Garrett Covington
The TriZetto Group, Inc.
Garrett.Covington at TriZetto.com
p: 3032046695 at vtext.com
w: 303-323-6886
c: 303-204-6695
|
<Prev in Thread] |
Current Thread |
[Next in Thread> |
- [Veritas-bu] Script(s) needed for amount backed up and,
Covington, Garrett <=
|
|
|