summaryrefslogtreecommitdiffstats
path: root/wiki/openshift/mysql-import.sh
diff options
context:
space:
mode:
Diffstat (limited to 'wiki/openshift/mysql-import.sh')
-rwxr-xr-xwiki/openshift/mysql-import.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/wiki/openshift/mysql-import.sh b/wiki/openshift/mysql-import.sh
new file mode 100755
index 0000000..619baf8
--- /dev/null
+++ b/wiki/openshift/mysql-import.sh
@@ -0,0 +1,15 @@
+#/bin/sh +x
+
+if [ $# != 1 ]; then
+ echo "usage: mysql-import.sh <file>"
+ exit 1
+fi
+
+FILE=`basename $1`
+DIR=`dirname $1`
+
+POD=`oc get pods -l deploymentconfig=mysql | grep -v NAME | awk '{ print $1; }'`
+
+oc rsync $DIR $POD:/tmp --exclude=* --include=$FILE --no-perms
+oc rsh $POD /opt/rh/rh-mysql57/root/usr/bin/mysql -u root wiki -e "source /tmp/$FILE"
+oc rsh $POD rm -rf /tmp/$FILE