1. First find the Windows Task Scheduler
2. Periodically call the. Bat program to point to the appropriate action by creating a Windows task schedule
1) Back up the MySQL data
The. bat code is as follows
@echo offset "ymd=%date:~,4%%date:~5,2%%date:~8,2%" e:/appserv/mysql/bin/mysqldump--opt-u root--password=password TestDB > E:/db/testdb_%ymd%.sql</span> @echo on
General settings 1 days to back up the database once, notice that the trigger needs to be enabled before it takes effect.
2) Regular monitoring of Apache server is normal
The principle is as follows
First, create a Web page that needs to contact the database, and the. Bat program runs when you first call this page to see if it returns to normal, such as returning a time-out or exception, calling the Apache server restart program to prevent the Web site from being accessed normally.
Restart Apache. bat
@echo offnet Stop apache2.2net start Apache2.2@echo on
Back up the database with Windows Task Scheduler and detect if Apache is functioning-sever Apache optimized configuration