From: Mark Wooding Date: Fri, 7 Jul 2017 10:01:40 +0000 (+0100) Subject: check-bkp-status.in: Force `sqlite3' output options to be correct. X-Git-Tag: 1.1.1~2 X-Git-Url: https://git.distorted.org.uk/~mdw/rsync-backup/commitdiff_plain/fafa928807d4d6ffb514bc47a9173b6a757a473c check-bkp-status.in: Force `sqlite3' output options to be correct. If the user has a `.sqlite3' file which overrides the default output options (quite likely, because the default format is rather ugly) then `check-bkp-status' gets very confused. So add a bunch of options: * `-batch' suppresses the annoying `Loading resources from HOME/.sqliterc' banner; * `-list' forces thing-separated items rather than tabulated output; * `-separator |' sets the thing which separates items; and * `-noheader' suppresses the column headings. Honestly there ought to be a `-norc' option, but there isn't. --- diff --git a/check-bkp-status.in b/check-bkp-status.in index d45c06b..75ddf60 100644 --- a/check-bkp-status.in +++ b/check-bkp-status.in @@ -407,7 +407,7 @@ backup () { case $host:$fs in $p) matchp=t; break ;; esac done case $matchp in nil) return ;; esac - when=$(sqlite3 $INDEXDB \ + when=$(sqlite3 -batch -list -separator \| -noheader $INDEXDB \ "SELECT MAX(date) FROM idx WHERE host = '$host' AND fs = '$fs';") case $when in "")