From 8b8350b8000e096693f68ca7d3a9350be94abf01 Mon Sep 17 00:00:00 2001 From: Chris Sharp Date: Mon, 13 Jan 2014 13:38:29 -0500 Subject: [PATCH] We need to get data/configuration from utility01 between upgrades. This script simplifies that task. --- grab-utility01-configs.sh | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 grab-utility01-configs.sh diff --git a/grab-utility01-configs.sh b/grab-utility01-configs.sh new file mode 100755 index 0000000..ca52c0d --- /dev/null +++ b/grab-utility01-configs.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# Copyright (C) 2014 Georgia Public Library Service +# Chris Sharp +# +# 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 . +# +# 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." -- 2.11.0