文档详情

bat-winrar命令行-ftp的运用.doc

发布:2019-09-21约1.09万字共8页下载文档
文本预览下载声明
最近由于一个网站要频繁的改动,并且修改完后必须要马上部署到远程服务器上,前几次手动压缩,上传,解压,还能忍受,但是次数多了,就开始烦了。于是有了写个批处理文件的想法。 压缩上传文件zip.bat的内容如下: rem 压缩网站文件目录,rar的命令行请参看rar帮助 c:\Program Files\WinRAR\WinRAR.exe a -as -r -EP1 d:\chat.rar F:\eclipse\workspace\chat\context\*.* rem 删除rar文件中的jar文件,这样就不用上传这些大块头了 c:\Program Files\WinRAR\WinRAR.exe d d:\chat.rar *.jar rem 上传 ftp -s:F:\vc\chatftp.txt 10 chatftp.txt文件内容如下: test test bell cd baoqf put d:\chat.rar bye exit 远程登录到服务器上,运行解压批处理文件: rem 解压,覆盖不提示 C:\WinRAR\WinRAR.exe x D:\data\baoqf\chat.rar D:\Tomcat\webapps\chat -r -y rem 深度拷贝,覆盖不提示 xcopy D:\Tomcat\webapps\chat\context D:\Tomcat\webapps\chat /e /Y xcopy D:\Tomcat\webapps\chat\perties D:\Tomcat\webapps\chat\WEB-INF\classes\perties /Y rem 重启tomcat d:\tomcat\bin\tomcat.exe stop d:\tomcat\bin\tomcat.exe start 批处理BAT文件运用o:p/o:p o:p/o:p 1. 所有内置命令的帮助信息 2. 环境变量的概念 3. 内置的特殊符号(实际使用中间注意避开) 4. 简单批处理文件概念 5. 附件1 tmp.txt 6. 附件2 sample.bat ###################################################################### 1. 所有内置命令的帮助信息 ###################################################################### ver cmd /? set /? rem /? if /? echo /? goto /? for /? shift /? call /? 其他需要的常用命令 type /? find /? findstr /? copy /? ______________________________________________________________________ 下面将所有上面的帮助输出到一个文件 echo ver tmp.txt ver tmp.txt echo cmd /? tmp.txt cmd /? tmp.txt echo rem /? tmp.txt rem /? tmp.txt echo if /? tmp.txt if /? tmp.txt echo goto /? tmp.txt goto /? tmp.txt echo for /? tmp.txt for /? tmp.txt echo shift /? tmp.txt shift /? tmp.txt echo call /? tmp.txt call /? tmp.txt echo type /? tmp.txt type /? tmp.txt echo find /? tmp.txt find /? tmp.txt echo findstr /? tmp.txt findstr /? tmp.txt echo copy /? tmp.txt copy /? tmp.txt type tmp.txt ______________________________________________________ ###################################################################### 2. 环境变量的概念 ###################################################################### ________________________________
显示全部
相似文档