{"id":422,"date":"2016-12-01T16:15:03","date_gmt":"2016-12-01T08:15:03","guid":{"rendered":"https:\/\/yyshell.com\/?p=422"},"modified":"2017-02-10T10:55:18","modified_gmt":"2017-02-10T02:55:18","slug":"windows%e4%b8%8b%e9%80%9a%e8%bf%87rar%e5%92%8cftp%e8%87%aa%e5%8a%a8%e5%a4%87%e4%bb%bd%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/yyshell.com\/?p=422","title":{"rendered":"Windows\u4e0b\u901a\u8fc7RAR\u548cFTP\u81ea\u52a8\u5907\u4efd\u6587\u4ef6"},"content":{"rendered":"<p>\u76ee\u524d\u4f01\u4e1a\u5907\u4efd\u4e2d\u9047\u5230\u8fd9\u6837\u4e00\u79cd\u60c5\u51b5\uff0c\u901a\u5e38\u5b58\u50a8\u90fd\u662f\u642d\u5efa\u5728linux\u5e73\u53f0\u4e0b\u7684\uff0c\u4f46\u5f88\u591a\u670d\u52a1\u5668\uff0c\u6bd4\u5982ERP\uff0cOA\u7b49\u53c8\u662f\u8dd1\u5728Windows\u73af\u5883\u4e0b\uff0c\u56e0\u6b64\uff0c\u6211\u4eec\u5f88\u96be\u901a\u8fc7\u4f20\u7edf\u7684scp\uff0c\u6216\u8005rsync\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u5907\u4efd\u3002\u5f53\u7136\uff0c\u4f60\u53ef\u4ee5\u5b89\u88c5cygwin\uff0c\u4f46\u662f\u6211\u4e2a\u4eba\u5f88\u4e0d\u63a8\u8350\u8fd9\u79cd\u505a\u6cd5\u3002<\/p>\n<p>\u5047\u8bbe\u4f60\u8981\u5907\u4efdD\u76d8\u4e0b\u7684apps\u6587\u4ef6\u5939\uff0c\u6392\u9664\u6587\u4ef6\u5939\u4e2d\u7684exe\u548cdll\u6587\u4ef6\uff0c\u548ctemp\u6587\u4ef6\u5939\uff1b\u4f60\u7684linux\u5907\u4efd\u5b58\u50a8\u7684ip\u662f192.168.1.218\uff0c\u4f60\u5df2\u5728linux\u670d\u52a1\u7aef\u642d\u5efa\u4e86ftp\u670d\u52a1\uff0c\u7528\u6237\u540d\u662fuser\uff0c\u5bc6\u7801\u662fyourpasswd\uff1a<\/p>\n<pre class=\"lang:batch decode:true\">@echo off\r\nset bak_date=%date:~0,4%-%date:~5,2%-%date:~8,2%\r\nd:\r\n\"C:\\Program Files\\WinRAR\\Rar.exe\" a -ma -r -rr5 -hprarmima -x*.exe -x*.dll -x*\\temp\\ d:\\%bak_date%apps \"d:\\apps\\\"\r\necho open 192.168.1.218&gt;ftp.txt\r\necho user&gt;&gt;ftp.txt\r\necho yourpasswd&gt;&gt;ftp.txt\r\necho binary&gt;&gt;ftp.txt\r\necho lcd d:\\&gt;&gt;ftp.txt\r\necho cd \/backup&gt;&gt;ftp.txt\r\necho put %bak_date%apps.rar&gt;&gt;ftp.txt\r\necho bye&gt;&gt;ftp.txt\r\nftp -s:ftp.txt\r\ndel ftp.txt\r\ndel %bak_date%apps.rar\r\nexit<\/pre>\n<p>\u89e3\u91ca\u4e0b\u4e0a\u9762\u811a\u672c\uff0c\u9996\u5148\u662f\u5b9a\u4e49\u65e5\u671f\u53d8\u91cf\uff0c\u683c\u5f0f\u662f2016-12-01\u8fd9\u6837\u7684\u7c7b\u578b\uff1b<\/p>\n<p>rar\u547d\u4ee4\u884c\u53c2\u6570\uff0ca\u662f\u538b\u7f29\uff0c-r\u662f\u9012\u5f52\uff0c\u7528\u4e8e\u538b\u7f29\u6587\u4ef6\u5939\u7528\uff0c-ma\u662f\u91c7\u7528\u7684\u538b\u7f29\u683c\u5f0f\u662frar5\u683c\u5f0f\uff0c-r -rr5\u662f\u521b\u5efa5%\u7684\u6062\u590d\u4fe1\u606f\uff0c\u8fd9\u5bf9\u4e8e\u5f88\u591a\u91cd\u8981\u6570\u636e\u6709\u91cd\u8981\u610f\u4e49\uff0c-hp\u662f\u52a0\u5bc6rar\u6587\u4ef6\u3002\u6709\u8f83\u9ad8\u7684\u5b89\u5168\u6027\uff0crar\u6587\u4ef6\u7684\u5bc6\u7801\u662f\u540e\u9762\u7684\u5b57\u7b26\u201crarmima\u201d\uff0c-x\u662f\u6392\u9664\u6587\u4ef6\u7c7b\u578b\u6216\u6587\u4ef6\u5939\uff1b\u538b\u7f29\u53c2\u6570\u52a0\u5b8c\u4e4b\u540e\uff0c\u662f\u7528\u6240\u7684\u6587\u4ef6\u5939\u4e3a&#8221;2016-12-01apps.rar&#8221;\u7c7b\u4f3c\u8fd9\u6837\u7684\u683c\u5f0f\uff0c\u6700\u540e\u9762\u4e3a\u8981\u538b\u7f29\u7684\u6587\u4ef6\u5939\u3002\u4e0a\u8ff0\u547d\u4ee4\u7eaf\u5c5e\u6f14\u793a\u529f\u80fd\uff0c\u5927\u5bb6\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u9700\u8981\u6dfb\u52a0\u53c2\u6570\uff0c\u4e0d\u7528\u50cf\u4e0a\u8ff0\u547d\u4ee4\u4e2d\u4e00\u6837\uff0c\u6dfb\u52a0\u7684\u90a3\u4e48\u591a\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u662f\u914d\u7f6eftp\uff0c\u6211\u4eec\u628aftp\u7684\u76f8\u5173\u547d\u4ee4\u5199\u5165d\u76d8\u7684ftp.txt\u6587\u4ef6\u4e2d\uff0cftp.txt\u6587\u4ef6\u4e2d\uff0c\u4f9d\u6b21\u662fftp\u7528\u6237\u540d\u3001\u5bc6\u7801\u3001\u4f20\u8f93\u6a21\u5f0f\uff08bin\uff09,\u5982\u679c\u8981\u4f20\u8f93\u5230ftp\u670d\u52a1\u5668\u7684backup\u5b50\u6587\u4ef6\u5939\uff0c\u5c31cd \/backup\uff0cput\u5c31\u662f\u5b9e\u9645\u7684\u4e0a\u4f20\u3002ftp -s:ftp.txt \u6267\u884c\u6b64ftp\u4efb\u52a1\uff0c\u6700\u540e\u662f\u5220\u9664ftp\u548c\u5df2\u7ecf\u5907\u4efd\u597d\u7684\u538b\u7f29\u5305\u3002<\/p>\n<p>\u628a\u4e0a\u9762\u5185\u5bb9\u590d\u5236\u5230\u4e00\u4e2atxt\u6587\u4ef6\u4e2d\uff0c\u91cd\u547d\u540d\u6210backup.cmd\uff0c\u5728windows\u8ba1\u5212\u4efb\u52a1\u4e2d\u9009\u5b9a\u4e00\u4e2a\u65f6\u95f4\u6267\u884c\u6b64\u811a\u672c\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<p>\u8865\u5145\u8bf4\u660e\u4e00\u70b9\uff0c\u5b9e\u9645\u4e0a\uff0cRAR\u672c\u8eab\u662f\u652f\u6301\u65e5\u671f\u53c2\u6570\u7684\uff0c\u4f7f\u7528\u65b9\u6cd5\u662f-ag[\u683c\u5f0f]\uff0c\u4e0d\u52a0\u683c\u5f0f\u7684\u8bdd\uff0c\u9ed8\u8ba4\u662fYYYYMMDDHHMMSS\u7c7b\u578b\uff0c\u7c7b\u4f3c\u8fd9\u6837\u201c20161201223648\u201d\u8fd9\u79cd\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u6211\u4eec\u7684\u811a\u672c\u8fd9\u6837\u6539\u4e0b\uff1a<\/p>\n<pre class=\"lang:batch decode:true \">@echo off\r\nd:\r\n\"C:\\Program Files\\WinRAR\\Rar.exe\" a -agYYYY-MM-DD -v10m -ma -r -rr5 -hprarmima -x*.exe -x*.dll -x*\\temp\\ d:\\apps- \"d:\\apps\\\"\r\necho open 192.168.1.218&gt;ftp.txt\r\necho user&gt;&gt;ftp.txt\r\necho yourpasswd&gt;&gt;ftp.txt\r\necho binary&gt;&gt;ftp.txt\r\necho lcd d:\\&gt;&gt;ftp.txt\r\necho cd \/backup&gt;&gt;ftp.txt\r\necho prompt&gt;&gt;ftp.txt\r\necho mput apps-*.rar&gt;&gt;ftp.txt\r\necho bye&gt;&gt;ftp.txt\r\nftp -s:ftp.txt\r\ndel ftp.txt\r\ndel apps-*.rar\r\nexit<\/pre>\n<p>\u8fd9\u6837\u751f\u6210\u7684\u6587\u4ef6\u662f\u201capps-2016-12-01.partX.rar\u201d\u7c7b\u578b,-v\u662f\u542f\u7528\u5206\u5377\u538b\u7f29\u65b9\u5f0f\uff0c\u540e\u9762\u76f4\u63a5\u8ddf\u6bcf\u4e2a\u5377\u7684\u5927\u5c0f\uff0c\u6b64\u5904\u662f10MB\uff0c\u6ce8\u610f\uff0c10M\u662f10m\u53c2\u6570\u542b\u4e49\u4e0d\u4e00\u6837\uff0c10m\u4e3a1024\u8fdb\u5236\u768410MiB\u5927\u5c0f\uff0c10M\u4e3a1000\u8fdb\u5236\u768410MB\u5927\u5c0f\uff0c\u5e0c\u671b\u5927\u5bb6\u4e0d\u8981\u641e\u6df7\u4e86\uff0c\u3002<\/p>\n<h3>\u5173\u4e8e\u589e\u91cf\u5907\u4efd\u7684\u4f7f\u7528\uff1a<\/h3>\n<p>\u5f88\u591a\u4eba\u4e0d\u77e5\u9053\uff0crar\u81ea\u5e26\u589e\u91cf\u5907\u4efd\u529f\u80fd\uff0c\u901a\u8fc7\u4f7f\u7528-ac -ao\u529f\u80fd\uff0c\u53ef\u4ee5\u6bd4\u8f83\u5b8c\u7f8e\u7684\u5b9e\u73b0\u589e\u91cf\u5907\u4efd\u529f\u80fd\u3002-ac\u662f\u538b\u7f29\u5b8c\u6587\u4ef6\u540e\uff0c\u628a\u6587\u4ef6\u7684\u5b58\u6863\u5c5e\u6027\uff0c\u5c31\u662fa\u5c5e\u6027\u53bb\u9664\uff0c-ao\u4e3a\u53ea\u6dfb\u52a0\u5177\u6709\u5b58\u6863\u5c5e\u6027\u7684\u6587\u4ef6\u3002\u5f53\u65b0\u5efa\u6587\u4ef6\u6216\u8005\u4fee\u6539\u6587\u4ef6\u65f6\uff0c\u539f\u5148\u6ca1\u6709\u5b58\u6863\u5c5e\u6027a\u7684\u6587\u4ef6\uff0c\u5c31\u4f1a\u81ea\u52a8\u5177\u6709\u5b58\u6863\u5c5e\u6027\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u5bf9\u5f53\u524d\u76ee\u5f55\u4e0b\u7684testdirforrar\u6587\u4ef6\u5939\u8fdb\u884c\u589e\u91cf\u5907\u4efd\uff0c\u538b\u7f29\u6210test.rar\u6587\u4ef6\uff0c\u53ef\u4ee5\u8fd9\u6837\u5199\u3002<\/p>\n<pre class=\"lang:batch decode:true \">c:\\totalcmd\\Utilities\\RAR\\Rar.exe a -ma -rr5 -r -ac -ao test testdirforrar<\/pre>\n<p>\u8fd9\u6837\uff0c\u901a\u8fc7rar\u81ea\u5e26\u7684\u547d\u4ee4\uff0c\u6211\u4eec\u5c31\u5b9e\u73b0\u4e86\u7b80\u5355\u7684\u5907\u4efd\uff0c\u8fd9\u4e2a\u6bd4\u7f51\u4e0a\u5f88\u591a\u590d\u6742\u7684\u589e\u52a0\u5907\u4efd\u811a\u672c\u65b9\u4fbf\u591a\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u524d\u4f01\u4e1a\u5907\u4efd\u4e2d\u9047\u5230\u8fd9\u6837\u4e00\u79cd\u60c5\u51b5\uff0c\u901a\u5e38\u5b58\u50a8\u90fd\u662f\u642d\u5efa\u5728linux\u5e73\u53f0\u4e0b\u7684\uff0c\u4f46\u5f88\u591a\u670d\u52a1<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,3,7],"tags":[73,72,71,21],"class_list":["post-422","post","type-post","status-publish","format-standard","hentry","category-software","category-windows","category-7","tag-backup","tag-ftp","tag-rar","tag-windows"],"_links":{"self":[{"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/posts\/422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yyshell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=422"}],"version-history":[{"count":7,"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/posts\/422\/revisions"}],"predecessor-version":[{"id":454,"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/posts\/422\/revisions\/454"}],"wp:attachment":[{"href":"https:\/\/yyshell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yyshell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yyshell.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}