Skip to content

Instantly share code, notes, and snippets.

@agungsp2000
Last active January 26, 2021 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agungsp2000/3869fe8bc969e79b453bf5f4cbe24801 to your computer and use it in GitHub Desktop.
Save agungsp2000/3869fe8bc969e79b453bf5f4cbe24801 to your computer and use it in GitHub Desktop.
cek error replikasi, klo ada skip dan continue
@echo off
@mysql -u root -ppasswordnya -e "show slave status \G;" | findstr /C:"Slave_SQL_Running: No" > NUL
if %errorlevel%==0 (GOTO:skipit) else (goto:fine)
:skipit
echo Skip error replikasi
rem buat file log error replikasi
echo Ada error @ %date% %time% >> "h:\executables\errorreplikasi.txt"
@mysql -u root -ppassword -e "show slave status \G;" >> "h:\executables\errorreplikasi.txt"
mysql -u root -ppasswordnya -e "stop slave;SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;start slave;"
goto:EOF
:fine
echo No Error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment