Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Backups, Veritas

NetBackup statistics, Part II

Submitted by on November 21, 2005 – 5:04 pm 3 Comments

This script uses the output of the script in the previous example to calculate yearly backup load for each Veritas NetBackup client.

#!/bin/ksh

WORKDIR=/var/adm/bin/bpstat
BACKUPS=$WORKDIR/backups
STATDIR=$WORKDIR/stats
PROCESS=1
gzip="/usr/local/bin/gzip"

if [ ! -d $WORKDIR ] || [ ! -d $BACKUPS ] || [ ! -d $STATDIR ] || [ `find $BACKUPS -type d | wc -l` -eq 0 ]
then
        echo "Souce directories not found. Exiting..."
        exit
fi

if [ $PROCESS -eq 1 ]
then
        if [ `find $STATDIR -type f | wc -l` -gt 0 ]
        then
                rm $STATDIR/*
        fi

        month="01"
        day="01"
        year="01"

        for year in 03 04 05 06 07 08 09 10
        do
                for month in 01 02 03 04 05 06 07 08 09 10 11 12
                do
                        for day in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31
                        do
                                if [ -d $BACKUPS/$month$day$year ]
                                then
                                        echo "Processing $BACKUPS/$month$day$year"
                                        if [ -f $BACKUPS/$month$day$year/final_output_cron.txt.gz ]
                                        then
                                                $gzip -d $BACKUPS/$month$day$year/final_output_cron.txt.gz
                                                cat $BACKUPS/$month$day$year/final_output_cron.txt | grep -v ZZTOTAL | while read line
                                                do
                                                        HOST=$(echo "$line" | awk -F',' '{print $1}')
                                                        SIZE=$(echo "$line" | awk -F',' '{print $2}')
                                                        if [ $HOST ] && [ $SIZE ]
                                                        then
                                                                echo "$HOST,$month-$day-$year,$SIZE" >> "$STATDIR/$HOST"
                                                        fi
                                                done
                                                $gzip $BACKUPS/$month$day$year/final_output_cron.txt
                                        fi
                                fi
                        done
                done
        done
fi

if [ -f $WORKDIR/combined_yearly_stats.csv ]
then
        rm $WORKDIR/combined_yearly_stats.csv
fi

find $STATDIR -type f | while read file
do
        cat $file >> $WORKDIR/combined_yearly_stats.csv
done

if [ -f $WORKDIR/combined_yearly_stats.csv ]
then
        chmod 777 $WORKDIR/combined_yearly_stats.csv
fi

chmod -R 777 $STATDIR

ftp -in webserver << bye
user username password
lcd /var/adm/bin/bpstat
cd /var/apache/htdocs/bpstat
put combined_yearly_stats.csv
lcd /var/adm/bin/bpstat/stats
cd /var/apache/htdocs/bpstat/stats
mput *
bye

(( MINUTES = SECONDS / 60 ))

echo "Processing and transfers complete in $MINUTES minutes"

Print Friendly, PDF & Email

3 Comments »

  • toysruslover says:

    I want to use Veritas Netbackup for My practice to Backup Oracle Database

  • Adam says:

    Dear Friends,

    Recently I have got new project I my company. Previously I was working on windows server domain, but not on exchange server.
    Due to my performance & hard work here, my senior has given me option to work in 2 teams:-
    1.NetBackup veritas team [version. 6.5]
    2.Microsoft Exchange server team [ exchange 2007 ]
    I am very much confused which options shall I choose. Both have very good technical infrastructure here on this project.
    Some of my friend suggest me for go according to my interest. But I Know abt me that I am the person who can generate interest in any field. I am very hardworking & sincere person & can learn thing very fast.
    Now question is in above 2 option which has :-
    1.Very good market value in future.
    2.Money
    3.Future growth

    Plz suggest me …… your sincere reply is anticipated…..

    With regards;
    Gaurav

    Because of

  • The Dark Knight says:

    hi all ,

    i am working in a mnc as a veritas netbackup admin .. dont know what i have to do to choose a bright carrier in cloud computing ..please help me with a learning plan.. and i have no idea about coding ..

Leave a Reply

%d bloggers like this: