SINGLE SCAN

Scan Localhost
    
    sudo ./scanpbnj 127.0.0.1

Mail latest changes in csv format to user bill

    sudo ./outputpbnj -q latestinfo -t csv |mail -s "PBNJ Latest Info" bill

AUTOMATED SCANS WITH CRONJOBS

Copy the following into your /etc/crontab

    # scan of 10 net every 2 hours and email the latest changes to root
    16 */2 * * * root /root/bin/scan

    # monthly report of class c and email to root
    59 1 1 * * root /root/bin/monthly-report

Scan Every 2 Hours: 

/root/bin/scan contains the following:

#!/bin/sh
scanpbnj 192.168.10.\*
outputpbnj -q latestinfo -t csv | mail -s "PBNJ LatestInfo `date`" root

Monthly Report: 

/root/bin/monthly-report contains the following:

#!/bin/sh
MONTHYEAR=`date +%B-%Y`
cd /root/
mkdir report-$MONTHYEAR
cd report-$MONTHYEAR
scanpbnj 192.168.10.\*
outputpbnj -q monthlyreport -t csv | mail -s "PBNJ Month Report `date
+%B+%r`" root
