diff options
Diffstat (limited to 'linhes/linhes-system/lh_system_backup_job')
-rwxr-xr-x | linhes/linhes-system/lh_system_backup_job | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/linhes/linhes-system/lh_system_backup_job b/linhes/linhes-system/lh_system_backup_job index 14a3cf8..f634589 100755 --- a/linhes/linhes-system/lh_system_backup_job +++ b/linhes/linhes-system/lh_system_backup_job @@ -27,6 +27,12 @@ do fi done +if [ ! `mountpoint -q $BACKUPDISK 2> /dev/null` ]; then + echo " The system doesn't have a second drive. Backup skipped." + exit $backup_status +fi + + #find secondary backup location for dir in /data/storage/disk* do @@ -64,23 +70,24 @@ function backup(){ echo "Starting Backup" echo "Backup Directory: $BACKUPLINK --> $BACKUPDIR" echo "Secondary Backup Directory: $SECBACKUPLINK --> $SECBACKUPDIR" + echo mkdir -p $BACKUPDIR/$DATE #backup database if [ $SystemType = MasterBackend -o $SystemType = Standalone ] then echo - echo "Backup mysql databases" + echo "Backup mariadb databases" pacman -Q mysql 2>/dev/null if [ $? = 0 ] then echo " mythconverg (mythtv database)" - mysqldump -x mythconverg > $BACKUPDIR/$DATE/mythconverg + /usr/bin/mariadb-dump -x mythconverg > $BACKUPDIR/$DATE/mythconverg backup_status_check $? #this is everything echo " All databases in one file" - mysqldump -x --all-databases > $BACKUPDIR/$DATE/all_databases + /usr/bin/mariadb-dump -x --all-databases > $BACKUPDIR/$DATE/all_databases backup_status_check $? fi fi @@ -238,7 +245,7 @@ function remote_backup(){ if [ -n "$SECBACKUPDISK" ]; then SECBACKUP=$SECBACKUPDISK/backup - if [ `mountpoint -q -d $SECBACKUPDISK` ]; then + if [ `mountpoint -q $SECBACKUPDISK 2> /dev/null` ]; then if [ ! -d "$SECBACKUPDIR" ]; then mkdir -p -m 775 $SECBACKUPDIR echo " Created $SECBACKUPDIR" |