01. Back Up CRM source code

Source: Internet
Author: User

WinRAR command-line arguments:!WinRAR!a"!rarto!" "!from!"The path within the compressed file can be specified with-EP,-EP1, etc., but it seems that it is not good to specify only the folder containing the file, presumably:-ep3 includes the drive name,-EP2 does not include the drive, test EP EP1 are no folders, directly is the file;------------------- Winrar.exe parameter-ag[format]: Specify a time string for the file name of the compressed package; (%date:~0,4%%date:~5,2%%date:~8,2%)
-R: Along with subfolders;
Call:
  
 
  1. set "from=D:\source_asp\crm\crm\*"
  2. set "to=D:\source_asp\crm"
  3. set "name=crmasp"
  4. call "backup.bat" "!from!" "!to!" "!name!"
  5. pause


Backup.bat:
  
 
  1. @rem 作用:压缩文件,用来备份
  2. @rem 用法:call "backup.bat" "!from!" "!to!" "!name!"
  3. @rem 其他:
  4. @rem 2015/12/01 周二 15:54:55.85
  5. @echo off&SetLocal EnableDelayEdexpansion
  6. rem set "from=D:\sourse_klmy\crm\*.pbl"
  7. rem set "to=D:\sourse_klmy\源码\crm"
  8. rem set "name=crm"
  9. set "from=%~1"
  10. set "to=%~2"
  11. set "name=%~3"
  12. set winrar="C:\Program Files\WinRAR\WinRAR.exe"
  13. set "mdate=!date!"
  14. set "mdate=!mdate:/=-!"
  15. set "mdate=!mdate:\=-!"
  16. rem set "mdate=%date:~0,4%%date:~5,2%%date:~8,2%"
  17. set /p comment=输入附加说明:
  18. if defined comment (
  19. set "rarto=!to!\!name!_!mdate!_!comment!.rar"
  20. ) else (
  21. set "rarto=!to!\!name!_!mdate!.rar"
  22. )
  23. if exist "!rarto!" (
  24. echo !rarto! 已经存在..
  25. pause>nul
  26. exit
  27. )
  28. echo!rarto!
  29. !winrar! a -r "!rarto!" "!from!"
  30. if %errorlevel% == 0 (
  31. echo 压缩成功......
  32. ) else (
  33. echo 压缩失败....
  34. )
  35. echo;&echo;









From for notes (Wiz)

01. Back Up CRM source code

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.