{"id":2417,"date":"2013-01-14T17:07:55","date_gmt":"2013-01-14T09:07:55","guid":{"rendered":"https:\/\/kyle.ai\/blog\/?p=2417"},"modified":"2013-01-14T17:07:55","modified_gmt":"2013-01-14T09:07:55","slug":"linux%e4%b8%8bdropbox%e5%ae%9a%e6%97%b6%e5%90%8c%e6%ad%a5%e5%a4%87%e4%bb%bd","status":"publish","type":"post","link":"https:\/\/kyle.ai\/blog\/2417.html","title":{"rendered":"Linux\u4e0bDropBox\u5b9a\u65f6\u540c\u6b65\u5907\u4efd"},"content":{"rendered":"<p><span style=\"font-size: small;\">1\u3001\u5b89\u88c5<\/span><\/p>\n<p><span style=\"font-size: small;\">\u6309\u7167\u5b98\u65b9\u7684\u4ecb\u7ecd\u4e0b\u8f7ddropbox\uff0c\u547d\u4ee4\u884c\u4e0b\u8f93\u5165<\/span><br \/>\n<span style=\"font-size: small;\"> 32-bit\u7248\u672c:<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~ &amp;&amp; wget -O - &quot;https:\/\/www.dropbox.com\/download?plat=lnx.x86&quot; | tar xzf -\r\n<\/pre>\n<p><span style=\"font-size: small;\">64-bit\u7248\u672c:<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~ &amp;&amp; wget -O - &quot;https:\/\/www.dropbox.com\/download?plat=lnx.x86_64&quot; | tar xzf -\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u7136\u540e\u8fd0\u884c\uff1a<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n~\/.dropbox-dist\/dropboxd\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u7b2c\u4e00\u6b21\u8fd0\u884c\u7684\u65f6\u5019\u4f1a\u5f39\u51fa\u4e00\u4e2aURL\uff0c\u8981\u6c42\u4f60\u767b\u5165\u7f51\u9875\u7ed1\u5b9a\u4f60\u7684\u8d26\u6237\uff0c\u4e4b\u540e\u5c31\u4f1a\u5728home\u751f\u6210\u540c\u6b65\u6587\u4ef6\u5939\u3002<\/span><\/p>\n<p><span style=\"font-size: small;\">2\u3001\u5efa\u7acb\u8f6f\u8fde\u63a5\u5230\u5907\u4efd\u7f51\u7ad9\u3001\u76ee\u5f55\u5907\u4efd\u3002\u4f8b\u5982\uff1a<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd ~\/Dropbox\r\nln -s \/var\/www\/html web_backup\r\nln -s \/etc\/ etc_backup\r\n...\r\n#\u540e\u53f0\u540c\u6b65\r\n~\/.dropbox-dist\/dropboxd &amp;\r\n<\/pre>\n<p><span style=\"font-size: small;\">3\u3001\u5b9a\u65f6\u5907\u4efd\uff0c\u53ea\u5b9a\u65f6\u6253\u5f00\u4e00\u6bb5\u65f6\u95f4\u3001\u540c\u6b65\u4e00\u5929\u7684\u6587\u4ef6\u540e\u518d\u5173\u6389\uff0c\u4ee5\u8282\u7701\u8d44\u6e90<\/span><\/p>\n<p><span style=\"font-size: small;\">\u5148\u5173\u6389\u540c\u6b65\uff1a<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nkillall dropbox\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u7f16\u5199\u4e00\u4e2a\u5b9a\u65f6\u4efb\u52a1\u540c\u6b65\u811a\u672c\uff1a<\/span><\/p>\n<p><span style=\"font-size: small;\">vi backup.sh<\/span><br \/>\n<span style=\"font-size: small;\"> \u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n#!\/bin\/sh\r\nstart() {\r\n    echo starting dropbox\r\n    \/root\/.dropbox-dist\/dropboxd &amp;\r\n}\r\nstop() {\r\n    echo stoping dropbox\r\n    pkill dropbox\r\n}\r\ncase &quot;$1&quot; in\r\n    start)\r\n        start\r\n        ;;\r\n    stop)\r\n        stop\r\n        ;;\r\n    restart)\r\n        stop\r\n        start\r\n        ;;\r\nesac\r\n\r\n<\/pre>\n<p><span style=\"font-size: small;\">\u5b9a\u65f6\u8fd0\u884c\u548c\u5173\u95ed\uff1a<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nchmod +x backup.sh\r\ncrontab -e\r\n#\u8bbe\u7f6e\u6bcf\u59294\u70b9\u5f00\u59cb\u540c\u6b65\uff0c5\u70b9\u5173\u95ed\u540c\u6b65\u3002 \u5176\u5b9e\u4e00\u822c\u6bcf\u5929\u66f4\u65b0\u6570\u636e\u4e0d\u591a\u4e0d\u7528\u6253\u5f00\u8fd9\u4e48\u957f\u65f6\u95f4\uff0c\u8fd9\u4e2a\u6839\u636e\u5404\u4eba\u6bcf\u5929\u66f4\u65b0\u7684\u6570\u636e\u91cf\u81ea\u5df1\u6765\u8bbe\u7f6e\uff0e\r\n0 4 * * * sh \/root\/backup.sh restart\r\n0 5 * * * sh \/root\/backup.sh stop\r\n<\/pre>\n<p><span style=\"font-size: small;\">4. Linux\u4e0b\u5220\u9664\/\u5378\u8f7ddropbox\u5ba2\u6237\u7aef\u65b9\u6cd5\uff1a<\/span><\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nkillall dropbox\r\nrm -rf .dropbox .dropbox-dist Dropbox dropbox.tar.gz\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u5b89\u88c5 \u6309\u7167\u5b98\u65b9\u7684\u4ecb\u7ecd\u4e0b\u8f7ddropbox\uff0c\u547d\u4ee4\u884c\u4e0b\u8f93\u5165 32-bit\u7248\u672c: cd ~ &amp;&amp;  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-2417","post","type-post","status-publish","format-standard","hentry","category-skill"],"_links":{"self":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/comments?post=2417"}],"version-history":[{"count":1,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2417\/revisions"}],"predecessor-version":[{"id":2418,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/posts\/2417\/revisions\/2418"}],"wp:attachment":[{"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/media?parent=2417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/categories?post=2417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kyle.ai\/blog\/wp-json\/wp\/v2\/tags?post=2417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}