Thank you for every time, and I'll ask for help for mariaDB Backup.
I set consistent MariaDB Backup job based on veeam white paper.
But, it was failed and there is no other log except for the message 'mysql command has failed (bad credentials?) by script intentionally in /var/log/messages.
I don't know where to find log.
Should I consider specific thins for MariaDB Backup?
And, Please let me know troubleshooting method for linux mariaDB backup.
p.s. From googling, it should be used different method between Pure InnoDB and mix of InnoDB and MYISAM.
Is it right?
The code I used is below.
Code: Select all
#!/bin/bash
use_credentials="-uroot -p"
timeout=300
lock_file=/tmp/mysql_tables_read_lock
opts="$opts $use_credentials"
sleep_time=$((timeout+10))
rm -f $lock_file
echo "$0 executing FLUSH TABLES WITH READ LOCK"| logger
mysql $opts -e "FLUSH TABLES WITH READ LOCK; system touch $lock_file; system nohup sleep $sleep_time; system echo\ lock released|logger; " > /dev/null &
mysql_pid=$!
echo "$0 child pid $mysql_pid" | logger
c=0
while [ ! -f $lock_file ]
do
# check if mysql is running
if ! ps -p $mysql_pid 1>/dev/null ; then
echo "$0 mysql command has failed (bad credentials?)" | logger
exit 1
fi
sleep 1
c=$((c+1))
if [ $c -gt $timeout ]; then
echo "$0 timeout waiting for lock" | logger
touch $lock_file
kill $mysql_pid
fi
done
echo $mysql_pid > $lock_file
exit 0
Hypervisor: VMware ESXi 6.0
Tools version: 10.0.6.54238
Guest OS Version: Centos release 6.4 (Final)
Kernel version: 2.6.32-358.el6.x86_64
MariaDB Version: 10.1.18-MariaDB