Page 1 of 1

Hook for mysqlcheck repairs databases

Posted: March 6th, 2023, 9:11 am
by castris
Hi.

Before use hook for make a mysqlcheck all databases before backup job, I want to ask a question.

Jetbackup does a mysqlcheck before each backup job (global job) or before each mysqldump or individual job ?

If not is correcta my script

Code: Select all

#!/bin/bash
mysqlcheck --repair --all-databases

exit_code=$?

if [ $exit_code -eq 0 ]; then
echo "MySQL check was successful"
else
echo "MySQL checkfailed with exit code $exit_code"
fi

Script is on /hooks/mysqlchek.sh with 755 permissions and owner root.

Best regards

Re: Hook for mysqlcheck repairs databases

Posted: March 10th, 2023, 3:54 am
by JetAppsAdam
Hello castris,

Just to provide some clarification, JetBackup does not run the mysqlcheck command during the backup process. Your script appears to be correct, and I was able to verify this on a test environment. If you want this to run before your backup job you can go to Hooks > Create New Hook > Hook Position Pre > Hook Type Backup > Hook Script /hooks/mysqlchek.sh. Additionally, if you'd only like this script to run prior to specific backup jobs you have the option to set these here as well.

https://docs.jetbackup.com/v5.2/adminpanel/hooks.html