From: Mark Wooding Date: Fri, 7 Jun 2024 22:22:15 +0000 (+0100) Subject: track-boxing-progress: Script I used to track the boxing job. X-Git-Url: https://git.distorted.org.uk/~mdw/dvddb/commitdiff_plain?ds=sidebyside track-boxing-progress: Script I used to track the boxing job. --- diff --git a/track-boxing-progress b/track-boxing-progress new file mode 100755 index 0000000..2ffcbb6 --- /dev/null +++ b/track-boxing-progress @@ -0,0 +1,14 @@ +#! /bin/sh -e + +set -- $(psql -At -F" " -hroadstar -c ' + SELECT * FROM + (SELECT COUNT(*) FROM dvd_disc) AS ndisc, + (SELECT COUNT(*) FROM dvd_disc WHERE box IS NOT NULL) AS nboxed, + (SELECT COUNT(*) FROM + (SELECT DISTINCT box FROM dvd_disc + WHERE box IS NOT NULL) AS q) + AS nbox; +'); ndisc=$1 nboxed=$2 nbox=$3 + +echo "DONE $nboxed/$ndisc = $(( (100*$nboxed + $ndisc/2)/$ndisc ))%" +echo "BOXES $nbox + $(( (($ndisc - $nboxed)*$nbox + $nboxed - 1)/$nboxed ))" \ No newline at end of file