]> git.evergreen-ils.org Git - contrib/pines.git/blob - grab-utility01-configs.sh
add local git tar script
[contrib/pines.git] / grab-utility01-configs.sh
1 #!/bin/bash
2
3 # Copyright (C) 2014 Georgia Public Library Service
4 # Chris Sharp <csharp@georgialibraries.org>
5 #    
6 #    This program is free software: you can redistribute it and/or modify
7 #    it under the terms of the GNU General Public License as published by
8 #    the Free Software Foundation, either version 3 of the License, or
9 #    (at your option) any later version.
10 #
11 #    This program is distributed in the hope that it will be useful,
12 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 #    GNU General Public License for more details.
15 #
16 #    You should have received a copy of the GNU General Public License
17 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 #
19 # A script to grab all of PINES' utility server data and configuration
20 # that needs to be moved to the new utility01 as created by GenaSYS.
21
22 WORKING_DIR="$PWD"
23 ARCHIVE_DIR="utility01-prod-`date +%F`"
24 CONF_DIR="/openils/conf"
25 SCRIPT_DIR="/home/opensrf/eg"
26 OVERDUE_DIR="/openils/var/data/overdue"
27 OFFLINE_DIR="/openils/var/data/offline"
28
29 if [ ! -d $ARCHIVE_DIR ]; then
30         mkdir $ARCHIVE_DIR
31 fi
32
33 cd $ARCHIVE_DIR || {
34          echo "Could not cd to $ARCHIVE_DIR." 
35          exit;
36 }
37
38 echo "Copying configuration directory $CONF_DIR..."
39 cp -r $CONF_DIR .
40 echo "Copying scripts directory $SCRIPT_DIR..."
41 cp -r $SCRIPT_DIR .
42 echo "Copying overdue data directory $OVERDUE_DIR..."
43 cp -r $OVERDUE_DIR .
44 echo "Copying offline data directory $OFFLINE_DIR..."
45 cp -r $OFFLINE_DIR .
46
47 cd $WORKING_DIR || { 
48         echo "Could not cd to $WORKING_DIR" 
49         exit;
50 }
51
52 echo "Compressing directory..."
53 tar czvf $ARCHIVE_DIR.tar.gz $ARCHIVE_DIR
54
55 echo "Done."