• 用XCOPY进行源代码备份


    以前备份程序,大多是直接将程序所在目录包括其下的子目录都进行打包压缩,所以会包含很多不需要的文件在备份的包 中,增加文件的大小.比如象VC项目的DEBUG目录等,小的10多M,大的几十M,这些经重新编译后会自动产生,没有必要进行备份.以下是用XCOPY 备份的脚本.备份之前先确定哪些类型(即文件扩展名)的文档需备份,备份之后如再进行压缩,目录备份文件就更精简了.

    把以下这些脚本指令贴在批处理文件中,设置相应源目录和目标目录的参数后运行即可.

    BACKUP.CMD

    SET VS2003FLG=
    SET VCFLG=

    SET DELPHIFLG=REM

     REM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    REM %  以下是VC项目源代码文件备份批处理指令                                 %
    REM %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    REM *************************************************************************
    REM * SOURCE_PATH:      为需备份的源目录环境变量                            *
    REM * BACKUP_DEST_PATH: 为备份的目标目录环境变量                            *
    REM * REM_FLG:          这是命令执行标志环境变量,值为REM 可使命令为注释状态 *
    REM *                   如设为空,则命令为有效状态
    REM *************************************************************************

    SET SOURCE_PATH=D:"Project"vc"
    SET BACKUP_DEST_PATH=E:"TEMP"CODEBK"VC
    SET REM_FLG=%VCFLG%

    %REM_FLG%  XCOPY  %SOURCE_PATH%*.APS   /S /E /I /H /R /Y   %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.H     /S /E /I /H /R /Y   %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.CPP   /S /E /I /H /R /Y   %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.CLW   /S /E /I /H /R /Y   %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.PLG   /S /E /I /H /R /Y   %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.OPT   /S /E /I /H /R /Y   %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.RC    /S /E /I /H /R /Y   %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.DSP   /S /E /I /H /R /Y   %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.DSW   /S /E /I /H /R /Y   %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.NCB   /S /E /I /H /R /Y   %BACKUP_DEST_PATH%

    %REM_FLG%  XCOPY  %SOURCE_PATH%*.RC2   /S /E /I /H /R /Y   %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.BMP   /S /E /I /H /R /Y   %BACKUP_DEST_PATH%

    REM 以下为程序运行时所需配置或数据文件

    %REM_FLG%  XCOPY  %SOURCE_PATH%*.Config   /S /E /I /H /R /Y  %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.ICO      /S /E /I /H /R /Y  %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.XML      /S /E /I /H /R /Y  %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.SQL      /S /E /I /H /R /Y  %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.INI      /S /E /I /H /R /Y  %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.XLS      /S /E /I /H /R /Y  %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.DOC      /S /E /I /H /R /Y  %BACKUP_DEST_PATH%
    %REM_FLG%  XCOPY  %SOURCE_PATH%*.TXT      /S /E /I /H /R /Y  %BACKUP_DEST_PATH%

  • 相关阅读:
    vagrant 修改配置生效
    Linux下如何获取CPU内存等硬件信息
    linux命令系列 sudo apt-get update和upgrade的区别
    docker-compose up 启动容器服务超时错误:ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information
    ERROR: manifest for hyperledger/fabric-orderer:latest not found
    fabric2.0开发 部署fabric环境和fabric-samples的启动(2)
    开源架构Fabric、FISCO BCOS(以下简称“BCOS”)、CITA 技术对比
    Centos 7 安装配置 Mariadb 数据库
    liblzma.so.5: version `XZ_5.1.2alpha' not found (required by /lib64/librpmio.so.3)
    ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found
  • 原文地址:https://www.cnblogs.com/chenhs/p/1270774.html
Copyright © 2020-2023  润新知