sitelink1 | |
---|---|
sitelink2 | |
extra_vars5 | |
extra_vars6 |
--------------------------------------------------------
#!/bin/sh
LOG='/home/kebi/mysql_restart.log'
ERR='/home/kebi/mysql_restart.err'
/usr/bin/date >> ${LOG}
/usr/bin/date >> ${ERR}
/usr/local/mysql/bin/mysqlcheck --auto-repair -ukebi -pkebi mail > ${LOG} 2> ${ERR}
sleep 30
/etc/rc.mysqld stop
/etc/rc.mysqld start
echo >> ${LOG}
echo >> ${ERR}
--------------------------------------------------------
cron에 다음을 등록하여 실행하면 매일 자동으로 위 스크립트를 수행시킬 수 있다.
0 1,6,12,18 * * * /home/kebi/mysql_restart.sh (매일 1시,6시,12시,18시에 mysql_restart.sh를 실행한다)
#!/bin/sh
LOG='/home/kebi/mysql_restart.log'
ERR='/home/kebi/mysql_restart.err'
/usr/bin/date >> ${LOG}
/usr/bin/date >> ${ERR}
/usr/local/mysql/bin/mysqlcheck --auto-repair -ukebi -pkebi mail > ${LOG} 2> ${ERR}
sleep 30
/etc/rc.mysqld stop
/etc/rc.mysqld start
echo >> ${LOG}
echo >> ${ERR}
--------------------------------------------------------
cron에 다음을 등록하여 실행하면 매일 자동으로 위 스크립트를 수행시킬 수 있다.
0 1,6,12,18 * * * /home/kebi/mysql_restart.sh (매일 1시,6시,12시,18시에 mysql_restart.sh를 실행한다)