Windows platform unattended backup and release of updated batch processing scripts

Source: Internet
Author: User

this batch of processed files is executed as windows scheduled tasks, which enables unattended automatic update and automatically backs up the files in the released directory according to the file content in the update directory at night, then, release the files in the update directory to the release directory and generate the log function. You only need to modify the corresponding updatepath (to update the file storage directory ), backuppath (backup file storage directory), releasepath (release directory), and logfile (Daily Log File) can be defined.

Echo on
Set updatepath = D:/deleteme/update /*.*
Set backuppath = D:/deleteme/backup /*.*
Set releasepath = D:/deleteme/target /*.*
Set logfile = autoupdate_at _ % Date :~ 0, 10% _ % time :~ 0, 2%. Log
The echo Auto Release function is enabled. The enabling time is % date % time %> % logfile %.
Echo starts preparation and copies the files in the update directory to the backup directory...> % logfile %
Set preparecmdparameters =/S/C/R/k/y/F
Xcopy % updatepath % backuppath % preparecmdparameters %> % logfile %
Echo starts backup and copies the files in the released directory to the backup directory...> % logfile %
Set backupcmdparameters =/S/C/R/k/y/f/u
Xcopy % releasepath % backuppath % backupcmdparameters %> % logfile %
Echo starts the release and copies the files in the update directory to the release directory...> % logfile %
Set updatecmdparameters =/S/C/R/k/y/F
Xcopy % updatepath % releasepath % updatecmdparameters %> % logfile %
The Automatic Echo publishing function is disabled. The closing time is % date % time %> % logfile %.
Echo off

 

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.