Bug 9260: stop koha-run-backups complaining "missing ]"
authorMJ Ray <mjr@phonecoop.coop>
Tue, 11 Dec 2012 14:17:36 +0000 (14:17 +0000)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Fri, 21 Dec 2012 13:11:39 +0000 (08:11 -0500)
Found because cron.daily/koha output contains the error "[: 97: missing ]"

To test:

  1. run koha-run-backups --days 2 --output /var/spool/koha
  2. should see no output

Sponsored-by: Library of the Józef Piłsudski Institute of America
Signed-off-by: Vitor FERNANDES <vfernandes@keep.pt>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I still get an error:
  ./koha-run-backups: 58: ./koha-run-backups: koha-list: not found
But this patch fixes the syntax error
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
debian/scripts/koha-run-backups

index 0aafc52..74f879b 100755 (executable)
@@ -58,7 +58,7 @@ done
 for name in $(koha-list --enabled | grep -Fxv demo)
 do
     koha-dump "$name" > /dev/null
-    if [ -z "$dirname"]; then
+    if [ -z "$dirname" ]; then
         backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' /etc/koha/sites/$name/koha-conf.xml )";
     else
         backupdir="$dirname/$name";