summaryrefslogtreecommitdiffstats
path: root/linhes/linhes-system/lh_system_backup
diff options
context:
space:
mode:
Diffstat (limited to 'linhes/linhes-system/lh_system_backup')
-rwxr-xr-xlinhes/linhes-system/lh_system_backup32
1 files changed, 32 insertions, 0 deletions
diff --git a/linhes/linhes-system/lh_system_backup b/linhes/linhes-system/lh_system_backup
new file mode 100755
index 0000000..b3df6e1
--- /dev/null
+++ b/linhes/linhes-system/lh_system_backup
@@ -0,0 +1,32 @@
+#!/bin/bash
+. /etc/systemconfig
+lh_notify-send "Starting Backup..."
+#alert user the database will not be backed up
+if [ $SystemType != MasterBackend -a $SystemType != Standalone ]
+then
+ lh_notify-send "This is not the MasterBackend.\n Skipping backup of database."
+fi
+
+if [ $SystemType = MasterBackend -o $SystemType = Standalone ]
+then
+ lh_notify-send "Stopping MythBackend..."
+ systemctl stop mythbackend.service
+fi
+
+#do the backup
+lh_notify-send "Starting system backup..."
+lh_system_backup_job 2>&1 > /var/log/system_backup.log
+rc=$?
+if [ $SystemType = MasterBackend -o $SystemType = Standalone ]
+then
+ lh_notify-send "Starting MythBackend..."
+ systemctl start mythbackend.service
+fi
+
+if [ $rc = 0 ]
+then
+ complete_message="Backup completed successfully."
+else
+ complete_message="Backup failed."
+fi
+lh_notify-send "$complete_message"