backupsrc.cmd 741 B

123456789101112131415161718192021222324252627
  1. rem *** Backup sources to archive ***
  2. @echo off
  3. rem *** Archive general settings ***
  4. set source=d:\Projects\
  5. set target=%CD%
  6. set archive_prefix=Projects
  7. set archive_ext=.7z
  8. set packer_dir=d:\Projects\quadarax\qdr.fnd\Assets\Tools
  9. rem obtain datetime parts
  10. set CUR_YYYY=%date:~10,4%
  11. set CUR_MM=%date:~4,2%
  12. set CUR_DD=%date:~7,2%
  13. set CUR_HH=%time:~0,2%
  14. if %CUR_HH% lss 10 (set CUR_HH=0%time:~1,1%)
  15. set CUR_NN=%time:~3,2%
  16. set CUR_SS=%time:~6,2%
  17. set CUR_MS=%time:~9,2%
  18. set SUBFILENAME=%CUR_YYYY%%CUR_MM%%CUR_DD%-%CUR_HH%%CUR_NN%%CUR_SS%
  19. set archive_full=%target%%archive_prefix%_%SUBFILENAME%%archive_ext%
  20. %packer_dir%\7z.exe a -xr!bin -xr!obj -xr!.vs -xr!.git %archive_full% %source%
  21. echo %archive_full% created