Metric system server-side file local geo-differential backup (incremental backup) script example

Source: Internet
Author: User

after the measurement product deploys the service end, because the service side has each kind of encapsulation encrypted attachment, the file and so on data, in order to safeguard the security of the information, in addition to establish the high availability backup mechanism, we can through the batch script, unifies to the system plan to carry on the local or the offsite backup, takes the capacity situation, may also adopt the incremental
The following code is a sample batch script that allows you to write a simple and powerful server-side backup strategy in your own way:

@echo off
REM ************************************************************
REM * Server-side file incremental backup, annual data saved in Destdir.
REM * requires setting source directory (SourceDir), backup directory (destdir=).
REM * If you want to back up files on the server offsite, make sure you can map the disks.
REM * and start the offsite backup code.
REM * Logs have information that records backups.
REM * The script can be added to the system plan for daily backups.

REM ************************************************************




REM ************************************************************
REM * Set Varialbes
REM ************************************************************


REM * Please set date FORMAT:YYYY-MM-DD


Set yearnum=%date:~0,4%
Set Sourcedir=c:\oaserver
Set destdir=d:\oabakdir\oaserver%yearnum%


REM * Offsite backup file mapping *******************************************
REM ************************************************************
REM * Remote Address
REM * Net use U: \\xxx.xxx.xxx.xxx\d$/user:administrator "Password"
REM * Set destdir=u:\oabakdir\oaserver%yearnum%
REM ************************************************************


if not exist%destdir%mkdir%destdir%
Set Logfilename=d:\oabakdir\oaserver%date:~0,4%%date:~5,2%%date:~8,2%. log


REM ************************************************************
REM *start
REM ************************************************************


echo ***************************************** >>%logfilename%
echo start:%date%%time% >>%logfilename%
echo START COPY (%date%%time%):%sourcedir% to%destdir% >>%logfilename%
xcopy%sourcedir%%destdir%/d/e/c/i/h/r/k/y>>%logfilename%
echo END COPY (%date%%time%):%sourcedir% to%destdir% >>%logfilename%
echo ***************************************** >>%logfilename%


REM * Delete Geo map *******************************************
REM ************************************************************
REM * Net use U:/delete
REM ************************************************************


@echo on
Exit

Original address: http://bbs.delit.cn/thread-298-1-1.html

Reprint please specify the source:

Author: metric Technology www. Delit. cn

Metric system server-side file local geo-differential backup (incremental backup) script example

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.