@@ -, +, @@
koha-mysql
---
debian/docs/koha-common.xml | 8 +++++
debian/docs/koha-mysql.xml | 1 +
debian/docs/koha-mysqldump.xml | 63 ++++++++++++++++++++++++++++++++++++
debian/koha-common.bash-completion | 3 +-
debian/koha-common.install | 1 +
debian/scripts/koha-mysqldump | 59 +++++++++++++++++++++++++++++++++
6 files changed, 134 insertions(+), 1 deletion(-)
create mode 100644 debian/docs/koha-mysqldump.xml
create mode 100755 debian/scripts/koha-mysqldump
--- a/debian/docs/koha-common.xml
+++ a/debian/docs/koha-common.xml
@@ -113,6 +113,14 @@
+
+
+
+
+ A wrapper for mysqldump for the specified koha instance.
+
+
+
Zebra-related
--- a/debian/docs/koha-mysql.xml
+++ a/debian/docs/koha-mysql.xml
@@ -63,6 +63,7 @@
See alsomysql (1)
+ koha-mysqlsump (1)koha-dump-defaults(8)koha-reset-passwd(8)koha-upgrade-schema(8)
--- a/debian/docs/koha-mysqldump.xml
+++ a/debian/docs/koha-mysqldump.xml
@@ -0,0 +1,63 @@
+
+koha-mysqldump
+
+Koha is the first free software library automation package.
+
+ The Koha Community
+ http://koha-community.org/
+
+
+
+
+
+
+ koha-mysqldump
+ 8
+
+
+
+ koha-mysqldump
+ Provide a flexible database dumper for the specified koha instance.
+ UNIX/Linux
+
+
+
+
+ koha-mysqldumpinstancenamemysqldump option
+
+
+
+ Description
+ A wrapper for mysqldump for the specified koha instance.
+
+
+ Example usage
+
+
+ Dump the database associated with a given instance. SQL output goes to STDOUT.
+
+ koha-mysqldumpinstancename
+
+
+
+ Dump data from TABLENAME matching the where clause, redirect output to a file
+
+ koha-mysqldumpinstancename TABLENAME --where "SOME SQL QUERY" < TABLENAME.sql
+
+
+
+
+
+ See also
+
+ mysqldump (1)
+ koha-mysql (1)
+ koha-dump-defaults(8)
+ koha-reset-passwd(8)
+ koha-upgrade-schema(8)
+
+
+
+
+
+
--- a/debian/koha-common.bash-completion
+++ a/debian/koha-common.bash-completion
@@ -135,8 +135,9 @@ complete -F _koha_enabled_instances koha-start-zebra
complete -F _koha_enabled_instances koha-restart-zebra
complete -F _koha_enabled_instances koha-stop-zebra
-# koha-mysql autocompletes with a single instance name
+# koha-mysql* autocompletes with a single instance name
complete -F _koha_single_instance koha-mysql
+complete -F _koha_single_instance koha-mysqldump
_koha_list()
{
--- a/debian/koha-common.install
+++ a/debian/koha-common.install
@@ -20,6 +20,7 @@ debian/scripts/koha-foreach usr/sbin
debian/scripts/koha-indexer usr/sbin
debian/scripts/koha-list usr/sbin
debian/scripts/koha-mysql usr/sbin
+debian/scripts/koha-mysqldump usr/sbin
debian/scripts/koha-passwd usr/sbin
debian/scripts/koha-plack usr/sbin
debian/scripts/koha-rebuild-zebra usr/sbin
--- a/debian/scripts/koha-mysqldump
+++ a/debian/scripts/koha-mysqldump
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# koha-mysqldump: run mysqldump on the database of the specified Koha instance.
+# Copyright 2016 Barton Chittenden
+# Based on koha-mysql, which is Copyright 2011 Catalyst IT, Ltd
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+set -e
+
+umask 0077
+
+# include helper functions
+if [ -f "/usr/share/koha/bin/koha-functions.sh" ]; then
+ . "/usr/share/koha/bin/koha-functions.sh"
+else
+ echo "Error: /usr/share/koha/bin/koha-functions.sh not present." 1>&2
+ exit 1
+fi
+
+usage()
+{
+ local scriptname=$0
+ cat <