summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/lh_system_backup
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2013-02-01 02:01:24 (GMT)
committerJames Meyer <james.meyer@operamail.com>2013-02-01 02:01:24 (GMT)
commitbf9991d8258086515c1350d8719622c659924f37 (patch)
treefac9a7bfaffa435f69ecf7778509a1a78b9d802c /abs/core/LinHES-system/lh_system_backup
parentc7b9f42f1d529a30bb3534330e4973272d225593 (diff)
downloadlinhes_pkgbuild-bf9991d8258086515c1350d8719622c659924f37.zip
linhes_pkgbuild-bf9991d8258086515c1350d8719622c659924f37.tar.gz
linhes_pkgbuild-bf9991d8258086515c1350d8719622c659924f37.tar.bz2
LinHES-system: add lh_system_restore and lh_system_backup. These scripts are called from the mythmenu.
refs #900
Diffstat (limited to 'abs/core/LinHES-system/lh_system_backup')
-rwxr-xr-xabs/core/LinHES-system/lh_system_backup30
1 files changed, 30 insertions, 0 deletions
diff --git a/abs/core/LinHES-system/lh_system_backup b/abs/core/LinHES-system/lh_system_backup
new file mode 100755
index 0000000..61a0ec3
--- /dev/null
+++ b/abs/core/LinHES-system/lh_system_backup
@@ -0,0 +1,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"
+