blob: c2e1e54023b3d59941bf992cccdeb3eaeaac685e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#!/bin/bash
# ----
# Copyright (C) 2013-2020 - Reevo Project (http://reevo.org)
# License: Affero GPL version 3 - http://www.gnu.org/licenses/agpl.html
# ES: Este archivos es parte de: reevo-web (http://git.reevo.org/reevo/reevo-web)
# EN: This file is part of: reevo-web (http://git.reevo.org/reevo/reevo-web)
# ----
cd /srv/reevotech
if [ -z $1 ];
then
echo "You must specify the deployment codename"
exit
fi
DEPLOY=$1
DEPLOYFILE=`ls ./etc | grep $DEPLOY`
echo $DEPLOY
read
cd /srv/reevotech/bin/bkp/
RUTA=`cat ../../etc/global_config-$DEPLOY.php | grep '^$REEVO_PATH' | cut -d '"' -f 2`
DOMINIO=`cat $RUTA/etc/global_config-$DEPLOY.php | grep '^$REEVO_URL' | cut -d '"' -f 2`
USER=`cat $RUTA/etc/global_config-$DEPLOY.php | grep '^$REEVO_DB_USER' | cut -d '"' -f 2`
PASSWORD=`cat $RUTA/etc/global_config-$DEPLOY.php | grep '^$REEVO_DB_PASS' | cut -d '"' -f 2`
DB=`cat $RUTA/etc/global_config-$DEPLOY.php | grep '^$REEVO_DB_WIKI' | cut -d '"' -f 2`
TIMESTAMP=`date +%Y-%m-%d-%H:%M:%S`
echo ""
echo "Se va a generar una copia de la BD: $DB"
mysqldump --no-tablespaces --user=$USER --password=$PASSWORD $DB > "$RUTA/bkp/wiki/$DOMINIO-$DB-$TIMESTAMP.sql"
echo ""
echo "Se comprime la BD"
bzip2 "$RUTA/bkp/wiki/$DOMINIO-$DB-$TIMESTAMP.sql"
echo "Generamos enlace simbolico"
rm "$RUTA/bkp/wiki/ultimo"
ln -s "$RUTA/bkp/wiki/$DOMINIO-$DB-$TIMESTAMP.sql.bz2" "$RUTA/bkp/wiki/ultimo"
|