Last active
January 26, 2021 18:04
-
-
Save agungsp2000/3869fe8bc969e79b453bf5f4cbe24801 to your computer and use it in GitHub Desktop.
cek error replikasi, klo ada skip dan continue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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