#!/bin/sh
#] 
#] *********************
#] $ bash  "$d_bin""disk_usage.sh"  - uses du to show disk usage
# www.BillHowell.ca created 23Jul2015 for Toshiba laptop

# du options :  r = recursive, f = force (don't ask for persmission) 
#   -c  produce a grand total
#   -d  max_depth of sub-directory listing
#   -h  human readable form (eg 1 k  234M  2G)
#   -t, --threshold=SIZE, exclude entries smaller than SIZE if positive, or entries greater than SIZE if negative
#

dater=$(date +"%d%b%Y %kh%Mm")

d_log="/media/bill/SWAPPER/bin/"
p_log="$d_log""disk_usage_log.txt" 
p_cmd="$d_log""disk_usage_command.txt"

#] becho()  - 

	becho()
{
  echo             "$1"
  echo >>"$p_log"  "$1"
}  


#du_do()  $max_depth  $dir_toStudy

#] du_do()  - 

	du_do()
{  
becho  ""
becho  "**********************************************************"
becho  "$d_log""disk_usage_log        Date = $dater"
becho  ""bash   "/media/bill/SWAPPER/bin/disk_usage.sh"
becho  "du >>'$p_log' -ch  -t 1M  -d  $1    '$2'"
        du >>"$p_log" -ch  -t 1M  -d  $1    "$2"
becho  ""
becho  "end of routine, Date = $dater"
}  


#] du_home_bill()  - 

	du_home_bill()
{  
du_do  1  "/home/bill/"
du_do  1  "/home/bill/System_maintenance"
becho  "HOWELL_computer = $HOWELL_computer"
becho  ""
}  


#] du_HOWELL_BASE()  - 

	du_HOWELL_BASE()
{  
du_do  1  "/media/bill/HOWELL_BASE/"
becho  ""
}  


#] du_SWAPPER()  - 

	du_SWAPPER()
{  
du_do  1  "/media/bill/SWAPPER/"
becho  ""
}  


#**************************

#du_home_bill
#du_ADATA_CH11
#du_HOWELL_BASE
#du_SWAPPER
#du_do 1 "/media/bill/RaspPi_ext4_32Gb/" 
 du_do 1 "/home/bill/" 

# to run :    $ bash   "/media/bill/SWAPPER/bin/disk_usage.sh"



# enddoc
