Bug 32612: (QA follow-up) Remove worker.log
[srvgit] / debian / scripts / koha-run-backups
index 0aafc52..1433c06 100755 (executable)
@@ -28,16 +28,19 @@ This allows automation of backing up the koha data and configuration to the
 filesystem. It will keep the past so many backups, discarding older ones.
 
 Options:
-    --output:   the directory that the resulting files will be placed into.
-                (default: /var/spool/koha)
-    --days:     the number of days to keep backups around for
-                (default: 2)
+    --output /path     The directory that the resulting files will be placed into.
+                       (default: /var/spool/koha)
+    --days 2           The number of days to keep backups around for
+                       (default: 2)
+    --exclude-indexes  Exclude Zebra indexes from the backups (default: false)
 
 Note: backups produced using this tool can be restored using \`koha-restore'.
 EOH
 }
 
-CMD_LINE=`getopt -o h --long days:,output:,help -n 'koha-run-backups' -- "$@"`
+exclude_indexes=""
+
+CMD_LINE=`getopt -o h --long days:,output:,help,exclude-indexes -n 'koha-run-backups' -- "$@"`
 
 if [ $? != 0 ] ; then show_help ; exit 1 ; fi
 
@@ -50,6 +53,8 @@ while true ; do
             days=$2; shift 2 ;;
         --output)
             dirname=$2; shift 2 ;;
+        --exclude-indexes)
+            exclude_indexes='--exclude-indexes'; shift ;;
         --) shift ; break ;;
         *) echo "Unknown error parsing the command line!" ; exit 1 ;;
     esac
@@ -57,8 +62,8 @@ done
 
 for name in $(koha-list --enabled | grep -Fxv demo)
 do
-    koha-dump "$name" > /dev/null
-    if [ -z "$dirname"]; then
+    koha-dump ${exclude_indexes} "$name" > /dev/null
+    if [ -z "$dirname" ]; then
         backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' /etc/koha/sites/$name/koha-conf.xml )";
     else
         backupdir="$dirname/$name";