diff --git a/ChangeLog b/ChangeLog index 8a0ad4e9918dfc65fe7fccc0d551749513558ecc..1d135a7ba29404acece77727511e809b8b4cd145 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-10-30 Per Cederqvist <ceder@sedesopim.lysator.liu.se> + + Print status. + + * lysrdiff-status: New file. Print some status information about + the backup system. + 2006-10-25 Per Cederqvist <ceder@sedesopim.lysator.liu.se> Randomize new jobs. diff --git a/lysrdiff-status b/lysrdiff-status new file mode 100755 index 0000000000000000000000000000000000000000..00039be19788ab340f477043987dad8813c6bc81 --- /dev/null +++ b/lysrdiff-status @@ -0,0 +1,34 @@ +#!/bin/sh + +df -hl /lysrdiff/*/perm/lysrdiff +echo + +statecache=/tmp/cached-state + +for part in /lysrdiff/*/perm/lysrdiff +do + partno=`echo $part|sed 's%/lysrdiff/\([0-9]*\)/perm/lysrdiff%\1%'` + find $part/state -type f -printf " %TY-%Tm-%Td %TH:%TM:%TS $partno %P\n" \ + | sort > $statecache.$partno.$$ + mv -f $statecache.$partno.$$ $statecache-$partno + echo -n $partno':' + echo -n ' 'Tasks: `wc -l < $part/tasks` + echo -n ' 'Fresh: `find $part/state -name \*-start -ctime 0 -print|wc -l` + echo -n ' '1day: `find $part/state -name \*-start -ctime 1 -print|wc -l` + echo -n ' 'Stale: `find $part/state -name \*-start -ctime +1 -print|wc -l` + echo -n ' 'Tot: `ls $part/state/*-end|wc -l` + echo ' 'Err: `ls $part/state/*-fail 2>/dev/null|wc -l` +done +echo + +echo Failures: +echo +grep -h -- '-fail$' $statecache-* | sort +echo +echo Top 5 most stale backups: +echo +grep -h -- '-start$' $statecache-* | sort | head -5 +echo +echo All unfinished backup attempts: +echo +grep -h -- '-attempt$' $statecache-* | sort | head -5