blob: 99082ff948b64edc53e48935120a02a195f7228b (
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
|
#!/bin/bash
. /etc/systemconfig
BACKUPDIR=/data/storage/disk0/backup/system_backups
#find last backup
cd $BACKUPDIR
restore_file=`ls -t backup.*|head -1`
cd -
if [ $SystemType != Master_backend -a $SystemType != Standalone ]
then
msg_client.py --msg "This is not the Master backend.\n Skipping restore of database."
fi
#do the backup
msg_client.py --msg "Restoring from:\n$restore_file"
lh_system_restore_job $restore_file 2>&1 > /var/run/restore.log
rc=$?
if [ $rc = 0 ]
then
complete_message="Restore completed successfully"
else
complete_message="Restore failed!"
fi
msg_client.py --msg "$complete_message"
#don't try to restore DB if not master
|