Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Piotr Gawron
minerva-scripts
Commits
747650e6
Commit
747650e6
authored
Jun 25, 2018
by
Piotr Gawron
Browse files
restore script
parent
e6d9609f
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/restore.sh
0 → 100755
View file @
747650e6
#!/bin/bash
sudo
service tomcat7 stop
sudo cp
/opt/backup/backup.tar.gz
.
tar
-zxf
backup.tar.gz
gzip
-d
map_viewer_db.gz
if
[
-e
"map_images.tar.gz"
]
then
tar
-zxf
map_images.tar.gz
if
[
-e
"/var/lib/tomcat7"
]
then
CATALINA_HOME
=
"/var/lib/tomcat7"
fi
if
[
-e
"/var/lib/tomcat8"
]
then
CATALINA_HOME
=
"/var/lib/tomcat8"
fi
sudo rm
-rf
$CATALINA_HOME
/webapps/map_images/
sudo mv
map_images
$CATALINA_HOME
/webapps/
fi
if
[
!
-e
"~/.pgpass"
]
then
echo
"localhost:5432:*:map_viewer:123qweasdzxc"
>
~/.pgpass
chmod
0600 ~/.pgpass
fi
dropdb
-U
map_viewer map_viewer
;
createdb
-U
map_viewer map_viewer
;
psql
-U
map_viewer
-f
map_viewer_db map_viewer
sudo rm
backup.tar.gz
rm
map_images.tar.gz
rm
map_viewer_db
rm
minerva.war
sudo
service tomcat7 start
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment