[Cacti] backs up cacti and develops it as a Windows scheduled task.
Source: Internet
Author: User
@ Echo Off
Rem ========================================================== ==============================================
Rem Back up cacti Databases
Rem Perfectaction
Rem User Name
Set User = Root
Rem Password
Set PWD = ABC . 123
Rem Database Name
Set Database_name = Cacti
Rem Backup path
Set Backup_path = D: \ Cacti_mysql_bak \ Cacti_bak \
Rem Obtain the current system time string. It is applicable to the win2003 Chinese version or the win2003 English version with the Oriental Language Pack Installed.
Set Now = % Date :~ 0 , 4 % Date :~ 5 , 2 % Date :~ 8 , 2 % _ % Time :~ 0 , 2 % Time :~ 3 , 2 % Time :~ 6 , 2 %
Rem Mysqldump installation directory
Set Mysqldump_path = " C: \ Program Files \ mysql \ MySQL Server 5.0 \ bin \ "
Rem Run the BACKUP command
% Mysqldump_path % mysqldump-U % USER %-P % PWD % database_name % > % Backup_path % database_name % _ % Now % _ Bak . SQL
Rem ========================================================== ==============================================
Rem ========================================================== ==============================================
Rem Deletes expired cacti backups and keeps them for only one month.
Forfiles / P % backup_path % / S / M * . * / D- 31 / C " CMD/C del @ File "
Rem ========================================================== ==============================================
Rem ========================================================== ==============================================
Rem Back up RRD files
Copy C: \ Apache2 \ Htdocs \ Cacti \ RRA \ * . * D: \ Cacti_mysql_bak \ Rra_bak \ / Y
Rem ========================================================== ==============================================
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.