summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/lh_system_backup
blob: 61a0ec31abf530e57941be058d495edb332d4cef (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
#!/bin/bash
. /etc/systemconfig
msg_client.py --msg "Starting Backup"
#alert user the database will not be backed up
if [ $SystemType != Master_backend -a  $SystemType != Standalone ]
then
    msg_client.py --msg "This is not the Master backend.\n Skipping backup of database."
fi

if [ $SystemType = Master_backend -o  $SystemType = Standalone ]
then
    backend_control.sh stop 127.0.0.1
fi

#do the backup
lh_system_backup_job  2>&1 > /var/run/backup.log
rc=$?
if [ $SystemType = Master_backend -o  $SystemType = Standalone ]
then
    backend_control.sh start 127.0.0.1
fi

if [ $rc = 0 ]
then
    complete_message="Backup completed successfully"
else
    complete_message="Backup failed!"
fi
msg_client.py --msg "$complete_message"