initial commit of a *whole bunch* of old Egressive shell scripts, used to make many people redundant.
This commit is contained in:
commit
43e0f5b59e
329 changed files with 31937 additions and 0 deletions
6
egdu/conf/far.conf
Normal file
6
egdu/conf/far.conf
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
CHECK_DIR="/home/sites/public_html/far"
|
||||
ARGS="--exclude='.svn'"
|
||||
RECORD_DIR="/home/sites/public_html/far/var/"
|
||||
RECORD_FILE="egdu.xml"
|
51
egdu/egdu
Executable file
51
egdu/egdu
Executable file
|
@ -0,0 +1,51 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# create static XML page listing disk usage statistics for a directory
|
||||
#
|
||||
DIR="/etc/egdu"
|
||||
NAME="egdu"
|
||||
CMD="$DIR/egdu"
|
||||
CONFS=`find $DIR/conf/ -name "*.conf"`
|
||||
TIME=`date +"%Y-%m-%d"`
|
||||
#
|
||||
# set defaults
|
||||
#
|
||||
# remember to exclude Subversion data...
|
||||
GLOBAL_ARGS="-sh"
|
||||
DU=/usr/bin/du
|
||||
CUT=/bin/cut
|
||||
MODE="run"
|
||||
LOG="/var/log/$NAME.log"
|
||||
#
|
||||
# get command line args
|
||||
while test $# -ne 0 ; do
|
||||
case $1 in
|
||||
--help|?|-h)
|
||||
MODE="help"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if test $MODE == "run" ; then
|
||||
for CONF in $CONFS
|
||||
do
|
||||
# this file should define:
|
||||
# CHECK_DIR - directory tree to check
|
||||
# ARGS - arguments for the "du" command like --exclude values, etc.
|
||||
# RECORD_DIR - directory into which to put the resulting du values
|
||||
# RECORD_FILE - name of the file into which to put the results
|
||||
source $CONF
|
||||
echo "sourcing $CONF, executing $DU $GLOBAL_ARGS $ARGS $CHECK_DIR"
|
||||
DISK_USAGE=`$DU $GLOBAL_ARGS $ARGS $CHECK_DIR | $CUT -f 1`
|
||||
echo "<du date=\"$TIME\">$DISK_USAGE</du>" >> $RECORD_DIR/$RECORD_FILE
|
||||
done
|
||||
else
|
||||
echo "$NAME, copyright 2005 Egressive Limited, www.egressive.com"
|
||||
echo ""
|
||||
echo "Usage: $0 {--last | --this | -h}"
|
||||
echo "--last - last month's statistics"
|
||||
echo "--this - the current month's statistics"
|
||||
echo "-h or --help - this help message"
|
||||
fi
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue