We need to get data/configuration from utility01 between upgrades.
authorChris Sharp <csharp@georgialibraries.org>
Mon, 13 Jan 2014 18:38:29 +0000 (13:38 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 13 Jan 2014 18:38:29 +0000 (13:38 -0500)
This script simplifies that task.

grab-utility01-configs.sh [new file with mode: 0755]

diff --git a/grab-utility01-configs.sh b/grab-utility01-configs.sh
new file mode 100755 (executable)
index 0000000..ca52c0d
--- /dev/null
@@ -0,0 +1,50 @@
+#!/bin/bash
+
+# Copyright (C) 2014 Georgia Public Library Service
+# Chris Sharp <csharp@georgialibraries.org>
+#    
+#    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 <http://www.gnu.org/licenses/>.
+#
+# A script to grab all of PINES' utility server data and configuration
+# that needs to be moved to the new utility01 as created by GenaSYS.
+
+WORKING_DIR="$PWD"
+ARCHIVE_DIR="utility01-prod-`date +%F`"
+CONF_DIR="/openils/conf"
+SCRIPT_DIR="/home/opensrf/eg"
+OVERDUE_DIR="/openils/var/data/overdue"
+OFFLINE_DIR="/openils/var/data/offline"
+
+if [ ! -d $ARCHIVE_DIR ]; then
+       mkdir $ARCHIVE_DIR
+fi
+
+cd $ARCHIVE_DIR || echo "Could not cd to $ARCHIVE_DIR." 
+
+
+echo "Copying configuration directory $CONF_DIR..."
+cp -r $CONF_DIR .
+echo "Copying scripts directory $SCRIPT_DIR..."
+cp -r $SCRIPT_DIR .
+echo "Copying overdue data directory $OVERDUE_DIR..."
+cp -r $OVERDUE_DIR .
+echo "Copying offline data directory $OFFLINE_DIR..."
+cp -r $OFFLINE_DIR .
+
+cd $WORKING_DIR || echo "Could not cd to $WORKING_DIR" 
+
+echo "Compressing directory..."
+tar czvf $ARCHIVE_DIR.tar.gz $ARCHIVE_DIR
+
+echo "Done."