Hook for mysqlcheck repairs databases

cPanel, Industry leading hosting platform with world-class support.
Post Reply
castris
Posts: 5
Joined: January 27th, 2023, 8:00 pm

Hook for mysqlcheck repairs databases

Post 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
JetAppsAdam
Staff Member
Staff Member
Posts: 74
Joined: August 5th, 2022, 11:01 pm

Re: Hook for mysqlcheck repairs databases

Post 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
Thank you,

Adam G
JetApps, LLC.
JetApps.com | JetBackup.com
Post Reply