Teach you how to implement a timed remote server backup

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

When the site developed to a certain extent, most webmasters should consider the security of data and the stability of the site.

What if there is a hardware failure on the server? What if the data can't be found back? If the server is in the computer room is a failure, as in the previous period of time because of a large area of the filing problem, many webmaster because of the computer room problem, data can not be taken out, no way to find space or server to build the site, Can only wait for the computer room network back to normal. When we reach a certain size, we should have a lot of contingency plans to deal with these emergencies.

For these cases, we should do a regular backup of the data. For Web site backup, perhaps most people consider using FTP to achieve. But I personally feel that FTP is not very safe, like a lot of web site intrusion, are through the Serv right, so that the server's super management rights. So I never open FTP, and the general FTP tool can not achieve automatic timing download. Below I will webmaster help net how to use 7zip+vbs+ Task Manager to realize automatic backup data. The approximate steps are as follows:

1. Establish a database maintenance plan through SQL Server and generate a bak file in the specified directory. This step can be implemented through SQL Server. 1 o'clock in the morning daily. Backup time takes about 20 minutes.

2. To install the 7zip directory, copy the 7zip.exe to the database backup folder. Data is packaged into several files by 7zip. This is packaged into a number of files, mainly because the Linkhelper database has 13 g very large, in the back of the VBS download used to ado.stream,ado.stream file size restrictions. 7zip for free software. The Package command is:

REM Set Local Path

Echo off&setlocal enabledelayedexpansion

Delete the previous generated zip file before REM package

Del *.zip.*

Set "7z=7z.exe"

REM a indicates that adding-AOA represents an overlay-tzip represents the generation of a ZIP document-v800m the size of each packet file is 800m

"7z" A-aoa-tzip linkhelperdata-v800m *.bak

After REM packaging is complete, delete the *.bak file

Del *.bak

Choose 7zip Packaging because 7zip compression is very fast. Save the above code as "package. Bat" After backing up the database, also in the folder where the backup files of the database reside.

3. Create a new task through the Windows Scheduling task, run the "Back Up database and package. bat". The user is running the system user and the password is blank. The run time is 1 point 40 per day. 7zip compressed 13G of data, about half an hour, compressed total size of 2 G, will be divided into three compressed packets. Named respectively: linkhelperdata.zip.001 linkhelperdata.zip.002 linkhelperdata.zip.003

4. Use IIS to establish a site that points to the backup directory. Then create a new MIME type in the HTTP header in the IIS properties, with the extension input. *,mime type input: Application/octet-stream. This ensures that remote servers can download linkhelperdata.zip.001 files directly. To prevent data from being downloaded by someone else, we can also edit the security properties in the IIS properties to specify the allowed IP address.

With the above four steps, we have implemented the database server's data on a regular daily basis and then packaged. Here we implement a scheduled download backup of the remote server, which is done on another server.

5. Create a new VBS file to download, and to facilitate the management of backup files. We put the backup files downloaded every day into a directory named after today's date. Because the code is a bit long, you can enter http://blog.linkhelper.cn/post/vbs_download_file.html to view the detailed source code. Name the code download data. vbs.

6. Create a new Windows scheduled task on a remote server and run download data. vbs. The user is running the system user and the password is blank. The running time is 3 points per day.

Through the above 6 steps, we realize the database offsite scheduled backup. For web backups, we can do the same.

If you need to reprint, please retain the above links, indicated reproduced from the webmaster Help Net (http://www.linkhelper.cn). Thank you.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.