Commit cd712d08 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

backup script refactored

parent a1b0fb75
......@@ -8,25 +8,21 @@ rm -rdf $BACKUP_DIR
mkdir -p $BACKUP_DIR/tmp
mkdir -p "${BACKUP_FILE%/*}"
CATALINA_HOME="/var/lib/tomcat7"
cp $CATALINA_HOME/webapps/*.war "$BACKUP_DIR/tmp" 2>/dev/null
if [ -d "$CATALINA_HOME/webapps/map_images" ]
TOMCAT_VERSION="tomcat7"
if [ -e "/var/lib/tomcat7" ]
then
cd $CATALINA_HOME/webapps/
tar -zcf $BACKUP_DIR/tmp/map_images.tar.gz map_images
TOMCAT_VERSION="tomcat7"
fi
CATALINA_HOME="/var/lib/tomcat8"
cp $CATALINA_HOME/webapps/*.war "$BACKUP_DIR/tmp" 2>/dev/null
if [ -d "$CATALINA_HOME/webapps/map_images" ]
if [ -e "/var/lib/tomcat8" ]
then
cd $CATALINA_HOME/webapps/
tar -zcf $BACKUP_DIR/tmp/map_images.tar.gz map_images
TOMCAT_VERSION="tomcat8"
fi
if [ -e "/var/lib/tomcat9" ]
then
TOMCAT_VERSION="tomcat9"
fi
CATALINA_HOME="/var/lib/tomcat9"
CATALINA_HOME="/var/lib/$TOMCAT_VERSION"
cp $CATALINA_HOME/webapps/*.war "$BACKUP_DIR/tmp" 2>/dev/null
if [ -d "$CATALINA_HOME/webapps/map_images" ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment