-
Notifications
You must be signed in to change notification settings - Fork 0
/
backupTicket.sh
executable file
·36 lines (27 loc) · 939 Bytes
/
backupTicket.sh
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
#!/bin/bash
#
#
# Author: $Author$
# Revision: $Revision$
# Date: $Date$
#
# source the configuration file
source `dirname $0`/skybox_ha.conf
# global variables - start
prifile="$SKYUSERHOME/incron.primary"
MYSQLDUMP=`find /opt/skyboxview/thirdparty -path "*bin/mysqldump"`
# global variables - stop
# script start
# Check if this server is either Primary or secondary (if not exist)
if [ -e $prifile ]; then
echo "Production Primary Skybox Server Ok"
#I'm primary export ticket
NOW=$(date +"%Y%d%m%H%M%S")
$MYSQLDUMP --user root --password=manager -S /opt/skyboxview/data/db/mysql/mysql.sock skyboxview_live sbv_tickets sbv_ticket_events sbv_ticket_fields sbv_attachments sbv_phases > /opt/skyboxview/data/xml_models/ticket_backup.sql.$NOW
echo $NOW
echo `date +"%Y/%m/%d %H-%M-%S - Backup tickets finished successfully"` | tee -a $SKYBOXLOG
else
echo "Not Primary Skybox Server"
exit 255
fi
# script stop