Fixed an error if destination not present. Also fixed remote host ping still tries to ping even if remote_backup is disabled.

This commit is contained in:
deajan 2013-07-11 19:20:57 +02:00
parent 3835dfc0ec
commit bf551a5b9f
1 changed files with 7 additions and 5 deletions

View File

@ -2,8 +2,8 @@
###### Remote (or local) backup script for files & databases
###### (L) 2013 by Ozy de Jong (www.badministrateur.com)
OBACKUP_VERSION=1.83
OBACKUP_BUILD=2306201301
OBACKUP_VERSION=1.84
OBACKUP_BUILD=0807201301
DEBUG=no
SCRIPT_PID=$$
@ -413,6 +413,7 @@ function CheckSpaceRequirements
LogError "Local disk space may be insufficient to backup files (available space is lower than non compressed databases)."
fi
else
LOCAL_SQL_SPACE=0
LogError "SQL storage path [$LOCAL_SQL_STORAGE] doesn't exist."
fi
fi
@ -438,6 +439,7 @@ function CheckSpaceRequirements
LogError "Local disk space may be insufficient to backup files (available space is lower than full backup)."
fi
else
LOCAL_FILE_SPACE=0
LogError "File storage path [$LOCAL_FILE_STORAGE] doesn't exist."
fi
fi
@ -479,7 +481,7 @@ function CheckTotalExecutionTime
function CheckConnectivityRemoteHost
{
if [ "$REMOTE_HOST_PING" != "no" ]
if [ "$REMOTE_HOST_PING" != "no" ] && [ "$REMOTE_BACKUP" != "no" ]
then
ping $REMOTE_HOST -c 2 > /dev/null 2>&1
if [ $? != 0 ]
@ -529,7 +531,7 @@ function ListDatabases
$(which ssh) $SSH_COMP -i $SSH_RSA_PRIVATE_KEY $REMOTE_USER@$REMOTE_HOST -p $REMOTE_PORT "mysql -u $SQL_USER -Bse 'SELECT table_schema, round(sum( data_length + index_length ) / 1024) FROM information_schema.TABLES GROUP by table_schema;'" > /dev/shm/obackup_dblist_$SCRIPT_PID &
fi
else
mysql -u $SQL_USER -Bse 'SELECT table_schema, round(sum( data_length + index_length ) / 1024) FROM information_schema.TABLES GROUP by table_schema;' > /dev/shm/oback_dblist_$SCRIPT_PID &
mysql -u $SQL_USER -Bse 'SELECT table_schema, round(sum( data_length + index_length ) / 1024) FROM information_schema.TABLES GROUP by table_schema;' > /dev/shm/obackup_dblist_$SCRIPT_PID &
fi
child_pid=$!
WaitForTaskCompletition $child_pid $SOFT_MAX_EXEC_TIME_DB_TASK $HARD_MAX_EXEC_TIME_DB_TASK
@ -917,7 +919,7 @@ function RotateBackups
then
cp -R "$1/$backup" "$1/$backup.obackup.1"
else
mv "$1/backup" "$1/$backup.obackup.1"
mv "$1/$backup" "$1/$backup.obackup.1"
fi
done
}