因工作中要对数据打包,顺便研究了下WinRAR的命令行模式,自己写了些例子,基本用法如下: 测试压缩文件准备:文件夹test_data,内部包含子文件夹,分别存放了一些*.log和*.txt文件. 测试代码如下: rem 压缩全部文件,按类型压缩,zip打包 WinRAR.exe a num_all.zip .\test_data\ WinRAR.exe a num_txt.zip .\test_data\num*.txt WinRAR.exe a num_log.zip .\test_data
第一种:新建批处理文件 backup.dat,里面输入以下代码: 代码如下 复制代码 net stop mysql xcopy "C:/Program Files/MySQL/MySQL Server 5.0/data/piaoyi/*.*" D:/db_backup/%date:~0,10%/ /y net start mysql 注意:批处理命令中路径里有空格的话,必须在路径上加上双引号! 然后使用Windows的"计划任务"定时执行该批处理脚本即可.(例如: