#!/bin/bash set -eu set -o pipefail function todays_date { date '+%Y-%m-%d' } # THe ./disk-*-in-gig scripts are called without set -e, so they should just output nothing on error function disk_free { fs="$1" echo "$(todays_date)" "$(./disk-free-in-gig "$fs")" } function disk_used { fs="$1" echo "$(todays_date)" "$(./disk-used-in-gig "$fs")" } function disk_capacity { fs="$1" echo "$(todays_date)" "$(./disk-capacity-in-gig "$fs")" } function stats { fs="$1" base="$2" # disk_free "$fs" >> "$base".dat disk_used "$fs" >> "$base"-used.dat disk_capacity "$fs" >> "$base"-capacity.dat } stats /mymount/public_html/. public_html || true stats /mnt/backshift/. backshift stats /mymount/digital-assets/. digital-assets stats /mymount/bliz-mac-slash/. bliz-mac-slash stats /mymount/zareason-strata7440/. zareason-strata7440 stats /mymount/daniels-mac-mini/. daniels-mac-mini stats /mymount/dell-inspiron-530/. dell-inspiron-530 # stats /mymount/zareason2/. zareason2 stats /mymount/tp-mini-c/. tp-mini-c stats /mymount/tp-ppro tp-ppro stats /. zareason-limbo stats /mymount/dstromberg-precision-3530/. dstromberg-precision-3530 || true