{"id":252066,"date":"2022-09-16T09:26:32","date_gmt":"2022-09-16T01:26:32","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=252066"},"modified":"2022-09-06T09:57:32","modified_gmt":"2022-09-06T01:57:32","slug":"auto-backup-ftp","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/auto-backup-ftp.html","title":{"rendered":"\u5982\u4f55\u5b9e\u73b0\u6587\u4ef6\u81ea\u52a8\u5907\u4efd\u5e76\u4e0a\u4f20\u5230FTP\u670d\u52a1\u5668"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u672c\u6587\u4e3b\u8981\u4ecb\u7ecd\u600e\u4e48\u5c06\u6587\u4ef6\u670d\u52a1\u5668\u4e0a\u7684\u8d44\u6599\u8fdb\u884c\u538b\u7f29\u3001\u5907\u4efd\u5e76\u81ea\u52a8\u4e0a\u4f20\u5230\u6307\u5b9a\u7684FTP\u670d\u52a1\u5668\uff0c\u5b9e\u73b0\u6587\u4ef6\u7684\u5f02\u5730\u5907\u4efd\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5b9e\u73b0\u6587\u4ef6\u7684\u5f02\u5730\u5907\u4efd,\u5176\u5177\u4f53\u63aa\u65bd\u662f\u63d0\u524d\u90e8\u7f72\u597dFTP\u670d\u52a1\u5668\uff0c\u7136\u540e\u5c06\u9700\u8981\u5907\u4efd\u5230FTP\u670d\u52a1\u5668\u7684\u6240\u6709\u6587\u4ef6\u8fdb\u884c\u538b\u7f29\u5e76\u79fb\u52a8\u5230\u5176\u4ed6\u6587\u4ef6\u5939\u4e0b\uff0c\u6700\u540e\u4e0a\u4f20\u5230FTP\u670d\u52a1\u5668\u4fdd\u5b58\u3002\u786e\u4fdd\u672c\u5730\u548cFTP\u670d\u52a1\u7aef\u5404\u5b58\u4e00\u4efd\uff0c\u5b9e\u73b0\u6570\u636e\u5f02\u5730\u5907\u4efd\u3002<\/p>\n

\u4e00\u3001\u767b\u5f55linux\u7cfb\u7edf<\/strong><\/div>\n

\"\"<\/p>\n

\u4e8c\u3001\u67e5\u770bFTP\u670d\u52a1\u8fd0\u884c\u72b6\u6001<\/strong><\/div>\n

\"\"<\/p>\n

\u4e09\u3001\u7f16\u5199\u811a\u672c\u5b9e\u73b0\u6587\u4ef6\u7684\u81ea\u52a8\u5907\u4efd\u548c\u4e0a\u4f20<\/strong><\/div>\n

1\u3001Windows\u6587\u4ef6\u670d\u52a1\u5668<\/p>\n

\u9700\u6c42\uff1aWindows Server 2012 \u670d\u52a1\u5668\u4e0a\u521b\u5efa\u6587\u4ef6\u5939Share\uff0c\u9700\u8981\u5bf9\u6539\u6587\u4ef6\u5939\u8fdb\u884c\u538b\u7f29\u5907\u4efd\uff0c\u5e76\u4e0a\u4f20\u5230FTP\u670d\u52a1\u5668\u3002<\/p>\n

\u9996\u5148\uff0c\u5b89\u88c5\u538b\u7f29\u8f6f\u4ef6Winrar\u3002\u5982\u4e0b\u56fe<\/p>\n

\"\"<\/p>\n

\u5176\u6b21\uff0c\u7f16\u5199\u538b\u7f29\u5907\u4efd\u811a\u672c\u3002\u5982\u4e0b\u56fe<\/p>\n

\"\"<\/p>\n

\u6700\u540e\uff0c\u8bbe\u7f6e\u8ba1\u5212\u4efb\u52a1\uff0c\u5b9e\u73b0\u81ea\u52a8\u5907\u4efd\u3002\u5982\u4e0b\u56fe<\/p>\n

\"\"<\/p>\n

2\u3001Linux\u6587\u4ef6\u670d\u52a1\u5668<\/p>\n

\u9996\u5148\uff0c\u7f16\u5199FTP\u5907\u4efd\u811a\u672c\u3002\u5982\u4e0b\u6240\u793a<\/p>\n

#!\/bin\/bash\r\n\r\n#\u672c\u673a\u76ee\u5f55\r\n\r\nlive_dir=\"\/usr\/local\/backup\"\r\n\r\n#FTP\u670d\u52a1\u5907\u4efd\u76ee\u5f55\r\n\r\nbackup_dir=\"\/Files\/FileBackup\/Weaver\"\r\n\r\nftp -v -n 172.*.*.* <\r\n\r\nuser username password\r\n\r\nbinary\r\n\r\nhash\r\n\r\ncd $backup_dir\r\n\r\nlcd $live_dir\r\n\r\nprompt\r\n\r\nmput *.tar.gz\r\n\r\nbye\r\n\r\nEOF\r\n\r\necho \"commit to ftp successfully\"<\/pre>\n

\"\"<\/p>\n

\u5176\u6b21\uff0c\u6267\u884c\u8ba1\u5212\u4efb\u52a1\u6307\u4ee4# crontab \u2013e\u7f16\u5199\u5907\u4efd\u4efb\u52a1\u3002\u5982\u4e0b\u56fe<\/p>\n

* * * * * \/usr\/local\/FTP-backup.sh<\/pre>\n

\u683c\u5f0f\u8bf4\u660e\uff1a\u7b2c1\u5217\u4e3a\u5206\u949f\uff0c0\uff5e59\uff1b\u7b2c2\u5217\u4e3a\u5c0f\u65f6\uff0c0\uff5e23\uff1b\u7b2c3\u5217\u4e3a\u65e5\u671f\uff0c1\uff5e31\uff1b\u7b2c4\u5217\u4e3a\u6708\u4efd\uff0c1\uff5e12\uff1b\u7b2c5\u5217\u4e3a\u661f\u671f\uff0c0\uff5e7\uff080\u548c7\u8868\u793a\u661f\u671f\u5929\uff09\uff1b\u7b2c6\u5217\u4e3a\u8981\u8fd0\u884c\u7684\u547d\u4ee4\uff08\u5982\u679c\u6709\u591a\u4e2a\u547d\u4ee4\u7528 && \u9694\u5f00\uff09\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5b9e\u73b0\u6587\u4ef6\u7684\u5f02\u5730\u5907\u4efd,\u5176\u5177\u4f53\u63aa\u65bd\u662f\u63d0\u524d\u90e8\u7f72\u597dFTP\u670d\u52a1\u5668\uff0c\u7136\u540e\u5c06\u9700\u8981\u5907\u4efd\u5230FTP\u670d\u52a1\u5668\u7684\u6240\u6709\u6587\u4ef6\u8fdb\u884c\u538b\u7f29\u5e76\u79fb\u52a8\u5230 […]<\/p>\n","protected":false},"author":310,"featured_media":252087,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-252066","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/252066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/310"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=252066"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/252066\/revisions"}],"predecessor-version":[{"id":252128,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/252066\/revisions\/252128"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/252087"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=252066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=252066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=252066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}