diff options
author | Britney Fransen <brfransen@gmail.com> | 2024-02-24 18:48:29 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2024-02-24 18:48:29 (GMT) |
commit | 4f19c0414f2536dac843c6de3d60d5e697bb6bb6 (patch) | |
tree | ae977808b17316ec4313ed02a434f916595c40ba /linhes/linhes-system/lh_system_backup_job | |
parent | 867cf490478ae32ca6e321358ab4c48c7d6996fe (diff) | |
download | linhes_pkgbuild-4f19c0414f2536dac843c6de3d60d5e697bb6bb6.zip linhes_pkgbuild-4f19c0414f2536dac843c6de3d60d5e697bb6bb6.tar.gz linhes_pkgbuild-4f19c0414f2536dac843c6de3d60d5e697bb6bb6.tar.bz2 |
linhes-system: lh_system_backup_job: use mariadb-dump
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" |