{"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":"
\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 |