Description
1, to back up the file in the D-packing directory, named after the time (generally we through the security of God's good backup software to achieve backup) for example
D:\data_db_201112130001.BAK
D:\data_db_201112140002.BAK
D:\data_db_201112150003.BAK
A new file is automatically generated every day, such as December 16, 2011, which automatically generates Data_db_201112160004.bak
2, to the d:\ of the following day to generate the data back to the FTP server, for example, today is December 16, 2011, to data_db_201112160004.bak this file uploaded to the FTP server, and delete data from 7 days ago (only the last 7 days of backup)
FTP server: 192.168.1.1
Port: 21
User name: admin
Password: 123456
Backup file directory Databak
Save the following code to ask Data.bat, and add it to the scheduled task of Windows to automatically execute it every day.
Copy Code code as follows:
@echo off
Echo.
Set data=%date:~0,4%%date:~5,2%%date:~8,2%
set/a deldata=data-7
Echo Open 192.168.1.1 >ftp.txt
Echo Admin>>ftp.txt
Echo 123456>>ftp.txt
Echo Binary>>ftp.txt
echo CD Databak>>ftp.txt
echo LCD D:\>>ftp.txt
Echo Prompt>>ftp.txt
Echo Mput data_db_%data%*. BAK >>ftp.txt
Echo Mdelete data_db_%deldata%*. BAK >>ftp.txt
Echo Close>>ftp.txt
Echo Bye>>ftp.txt
Ftp.exe-s:ftp.txt
Echo.
For better stability, I generally use rsync to achieve backup, more convenient. The above software everyone to cloud Habitat Community Server commonly used software columns to download.