Quick Review: Boxee Box
December 27, 2011 – 12:22 am | 3 Comments

Some of the technical issues with Boxee Box could have been fixed if the dev team was paying more attention to addressing the bugs rather than adding “features” of dubious value. In the final analysis, for the price and ease of use, Boxee Box is the best in its class and price range. You just need to be mindful of its limitations and buy it in hope of future improvements to its usability.

Read the full story »
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, Scripts, Veritas

NetBackup statistics, Part I

Submitted by on November 21, 2005 – 4:59 pmOne Comment
NetBackup statistics, Part I

The following script will calculate total size of data backups for each Veritas NetBackup client over the past week (or as defined by the “daysago” variable in the script). The final output will be uploaded to a Web server. The output format is: clientname,backup_size_Gb

#!/bin/ksh
#
# ---------------------------------
# Set variables
# ---------------------------------
 
daysago=7
 
(( hoursago = daysago * 24 ))
 
# ---------------------------------
# Archive old output files
# ---------------------------------
 
if [ -r /var/adm/bin/bpstat/*_cron.txt ]
then
        if [ ! -d /var/adm/bin/bpstat/backups/`date '+%m%d%y'` ]
        then
                mkdir /var/adm/bin/bpstat/backups/`date '+%m%d%y'`
        else
                rm /var/adm/bin/bpstat/backups/`date '+%m%d%y'`/*
        fi
        mv /var/adm/bin/bpstat/*_cron.txt /var/adm/bin/bpstat/backups/`date '+%m%d%y'`/
        /usr/local/bin/gzip -r /var/adm/bin/bpstat/backups/`date '+%m%d%y'`/
fi
 
# ---------------------------------
# Manage archived files
# ---------------------------------
 
retain_weeks=25
 
if [ `ls /var/adm/bin/bpstat/backups/ | wc -l` -gt $retain_weeks ]
then
        count=`ls /var/adm/bin/bpstat/backups/ | wc -l`
        (( countrm = count  - retain_weeks ))
        countrm=`echo "-$countrm"`
        ls /var/adm/bin/bpstat/backups/ | tail -r | tail $countrm | while read line
        do
                rm -r "$line"
        done
fi
 
# ---------------------------------
# Extract list of NetBackup clients
# ---------------------------------
 
/usr/openv/netbackup/bin/admincmd/bpclclients -allunique -noheader | awk '{print $3}' > /var/adm/bin/bpstat/bpclients_cron.txt
 
# ---------------------------------
# Obtain NetBackup stats for the client list
# ---------------------------------
 
cat /var/adm/bin/bpstat/bpclients_cron.txt | while read line
do
        /usr/openv/netbackup/bin/admincmd/bpimagelist -hoursago $hoursago -U -client $line | egrep "Full|User|Differential" | fgrep -v "Sched Type" | fgrep -ve "--" | while read line2
        do
                currentkb=$(echo $line2 | awk '{print $5}')
                echo $line"                     "$currentkb >> /var/adm/bin/bpstat/nb2_cron.txt
        done
done
 
cat /var/adm/bin/bpstat/nb2_cron.txt | sort > /var/adm/bin/bpstat/temp_02.txt
mv /var/adm/bin/bpstat/temp_02.txt /var/adm/bin/bpstat/nb2_cron.txt
 
# ---------------------------------
# Process nb2_cron.txt
# ---------------------------------
 
i=10000000000000000000
cat /var/adm/bin/bpstat/nb2_cron.txt | while read line
do
        currenthost=$(echo $line | awk '{print $1}')
 
        if [ $i -ne 10000000000000000000 ]
        then
                if [ "$currenthost" = "$prevhost" ]
                then
                        currentsize=$(echo $line | awk '{print $2}')
 
                        (( i = i + currentsize ))
                else
                        i=$(echo $i | awk  '{ num = $1; gb = num / 1024 / 1024; print gb }')
                        echo $prevhost","$i >> /var/adm/bin/bpstat/final_output_cron.txt
                        echo $prevhost","$i
                        i=$(echo $line | awk '{print $2}')
                        prevhost=$currenthost
 
                fi
        else
                prevhost=$currenthost
                i=$(echo $line | awk '{print $2}')
        fi
done
 
total=0
cat /var/adm/bin/bpstat/final_output_cron.txt | awk -F',' '{print $2}' | while read line
do
        (( total = total + line ))
done
 
echo "ZZTOTAL for $daysago days [Gb],$total" >> /var/adm/bin/bpstat/final_output_cron.txt
 
mv /var/adm/bin/bpstat/final_output_cron.txt /var/adm/bin/bpstat/final_output.txt
 
chmod 777 /var/adm/bin/bpstat/final_output.txt
 
cd /var/adm/bin/bpstat
 
ftp -in webserver << bye
user username password
cd /var/apache/htdocs/bpstat
put final_output.txt
bye
 
mv /var/adm/bin/bpstat/final_output.txt /var/adm/bin/bpstat/final_output_cron.txt

Popularity: 4% [?]

Related posts:

  1. Using NetBackup to restore boot disk
  2. Using rsync to copy files
  3. Database operations with SQL and Korn shell
  4. FTP script with nested function

One Comment »

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.