summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/LinHES-system/bin/mythbackup
diff options
context:
space:
mode:
authorTom Culliton <culliton@x2.(none)>2009-01-11 01:55:28 (GMT)
committerTom Culliton <culliton@x2.(none)>2009-01-11 01:55:28 (GMT)
commiteb00fec42b6ccd143a145c89fff284969aa738be (patch)
tree60c2a07ee19660e58b899949a3d286b8fa57e457 /abs/core-testing/LinHES-system/bin/mythbackup
parent8aaf1c6cb3aca9ee0c95b9b5464c6fa40587e56b (diff)
downloadlinhes_pkgbuild-eb00fec42b6ccd143a145c89fff284969aa738be.zip
linhes_pkgbuild-eb00fec42b6ccd143a145c89fff284969aa738be.tar.gz
linhes_pkgbuild-eb00fec42b6ccd143a145c89fff284969aa738be.tar.bz2
Updates to make the backup and restore scripts work for Arch Linux and be
more portable in general. Also use the library facilities for checking on the existence of prerequisites.
Diffstat (limited to 'abs/core-testing/LinHES-system/bin/mythbackup')
-rwxr-xr-xabs/core-testing/LinHES-system/bin/mythbackup30
1 files changed, 15 insertions, 15 deletions
diff --git a/abs/core-testing/LinHES-system/bin/mythbackup b/abs/core-testing/LinHES-system/bin/mythbackup
index dfba611..d3cc4e8 100755
--- a/abs/core-testing/LinHES-system/bin/mythbackup
+++ b/abs/core-testing/LinHES-system/bin/mythbackup
@@ -1,18 +1,18 @@
#!/bin/bash
#----------------------------------------------------------------------------
-. $LinHES_ROOT/bin/backupcommon || {
+. /usr/LH/bin/backupcommon || {
echo 1>&2 "Can not load common settings!"
exit 1
}
#----------------------------------------------------------------------------
+# Prevent mythshutdown from shutting down the system in the middle...
+lock_myth
+
# Play a sound to let you know I'm starting.
play_sound init.wav
-# Prevent mythshutdown from shutting down the system in the middle...
-/usr/bin/mythshutdown --lock
-
# Keep a chain of recent backups,
echo "Starting rollover of old backups, this may take a while..."
[ -f "$BACKUP_SQL" ] && shrink $BACKUP_SQL
@@ -23,16 +23,16 @@ echo "Rollover completed."
# Start with the database backup, first we make sure it's healthy, and
# then we can dump it.
# Doing this while the backend is active would be BAD.
-/etc/init.d/mythtv-backend stop
+stop_mythbackend
# Stop, check, and fix $DATABASE db to ensure clean copy, then restart it.
-/etc/init.d/mysql stop
+stop_mysqld
cd $DATABASE_DIR
-/usr/bin/myisamchk -f *.MYI
-/etc/init.d/mysql stop ; /etc/init.d/mysql start
+$MYISAMCHK -f *.MYI
+start_mysqld
# Dumps the $DATABASE database
-/usr/bin/mysqldump -c -u root $DATABASE > $BACKUP_SQL
+$MYSQLDUMP -c -u root $DATABASE > $BACKUP_SQL
shrink $BACKUP_SQL
# Now to backup the other files, no fooling around, grab everything in the
@@ -41,13 +41,13 @@ shrink $BACKUP_SQL
# gather all the things in the list into a nice tidy bundle
cd /
-/bin/tar cvf $BACKUP_TAR $BACKUP_LIST 2>&1 |
- /bin/sed -e '/Error exit delayed from previous errors/d'
+$TAR cvf $BACKUP_TAR $BACKUP_LIST 2>&1 |
+ $SED -e '/Error exit delayed from previous errors/d'
shrink $BACKUP_TAR
# If you can't read this you've got no business restoring from it anyway.
-/bin/chown root:root $BACKUP_TAR* $BACKUP_SQL*
-/bin/chmod go-rwx $BACKUP_TAR* $BACKUP_SQL*
+$CHOWN root:root $BACKUP_TAR* $BACKUP_SQL*
+$CHMOD go-rwx $BACKUP_TAR* $BACKUP_SQL*
echo "Sanity checking your backup..."
play_sound testing.wav
@@ -63,9 +63,9 @@ else
fi
# Now we can restart the backend.
-/etc/init.d/mythtv-backend stop ; /etc/init.d/mythtv-backend start
+start_mythbackend
# Unlock the system again...
-/usr/bin/mythshutdown --unlock
+unlock_myth
exit $STATUS