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