{"id":82899,"date":"2023-11-04T13:47:10","date_gmt":"2023-11-04T05:47:10","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=82899"},"modified":"2023-11-04T13:47:10","modified_gmt":"2023-11-04T05:47:10","slug":"rsync-file-list","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/rsync-file-list.html","title":{"rendered":"\u4f7f\u7528rsync\u7684\u6587\u4ef6\u548c\u76ee\u5f55\u6392\u9664\u5217\u8868"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nrsync\u662f\u4e00\u4e2a\u5341\u5206\u6709\u7528\uff0c\u800c\u4e14\u5341\u5206\u6d41\u884c\u7684linux\u5de5\u5177\u3002\u5b83\u7528\u4e8e\u5907\u4efd\u548c\u6062\u590d\u6587\u4ef6\uff0c\u4e5f\u7528\u4e8e\u5bf9\u6bd4\u548c\u540c\u6b65\u6587\u4ef6\u3002\u6211\u4eec\u5df2\u7ecf\u5728\u524d\u9762\u7684\u6587\u7ae0\u8bb2\u8ff0\u4e86\u5982\u4f55\u5728Linux\u4e0b\u4f7f\u7528rsync\uff0c\u800c\u4eca\u5929\u6211\u4eec\u5c06\u589e\u52a0\u4e00\u4e9b\u66f4\u4e3a\u6709\u7528\u7684rsync\u4f7f\u7528\u6280\u5de7\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u6392\u9664\u6587\u4ef6\u548c\u76ee\u5f55\u5217\u8868<\/strong><\/div>\n

\u6709\u65f6\u5019\uff0c\u5f53\u6211\u4eec\u505a\u5927\u91cf\u540c\u6b65\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u60f3\u8981\u4ece\u540c\u6b65\u7684\u6587\u4ef6\u548c\u76ee\u5f55\u4e2d\u6392\u9664\u4e00\u4e2a\u6587\u4ef6\u548c\u76ee\u5f55\u7684\u5217\u8868\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u50cf\u8bbe\u5907\u6587\u4ef6\u548c\u67d0\u4e9b\u7cfb\u7edf\u6587\u4ef6\uff0c\u6216\u8005\u50cf\u4e34\u65f6\u6587\u4ef6\u6216\u8005\u7f13\u5b58\u6587\u4ef6\u8fd9\u7c7b\u5360\u636e\u4e0d\u5fc5\u8981\u78c1\u76d8\u7a7a\u95f4\u7684\u6587\u4ef6\u662f\u4e0d\u5408\u9002\u540c\u6b65\u7684\uff0c\u8fd9\u7c7b\u6587\u4ef6\u662f\u6211\u4eec\u9700\u8981\u6392\u9664\u7684\u3002<\/p>\n

\u9996\u5148\uff0c\u8ba9\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201cexcluded\u201d\u7684\u6587\u4ef6\uff08\u5f53\u7136\uff0c\u4f60\u60f3\u53d6\u4ec0\u4e48\u540d\u90fd\u53ef\u4ee5\uff09\uff0c\u7136\u540e\u5c06\u6211\u4eec\u60f3\u8981\u6392\u9664\u7684\u6587\u4ef6\u5939\u6216\u6587\u4ef6\u5199\u5165\u8be5\u6587\u4ef6\uff0c\u4e00\u884c\u4e00\u4e2a\u3002\u5728\u6211\u4eec\u7684\u4f8b\u5b50\u4e2d\uff0c\u5982\u679c\u4f60\u60f3\u8981\u5bf9\u6839\u5206\u533a\u8fdb\u884c\u5b8c\u6574\u7684\u5907\u4efd\uff0c\u4f60\u5e94\u8be5\u6392\u9664\u4e00\u4e9b\u5728\u542f\u52a8\u65f6\u521b\u5efa\u7684\u8bbe\u5907\u76ee\u5f55\u548c\u653e\u7f6e\u4e34\u65f6\u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u5217\u8868\u770b\u8d77\u6765\u50cf\u4e0b\u9762\u8fd9\u6837\uff1a
\n\"\"
\n\u7136\u540e\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5907\u4efd\u7cfb\u7edf\uff1a<\/p>\n

$ sudo rsync -aAXhv --exclude-from=excluded \/ \/mnt\/backup<\/pre>\n

\"\"\n<\/p>\n

\u4ece\u547d\u4ee4\u884c\u6392\u9664\u6587\u4ef6<\/strong><\/div>\n

\u4f60\u4e5f\u53ef\u4ee5\u4ece\u547d\u4ee4\u884c\u76f4\u63a5\u6392\u9664\u6587\u4ef6\uff0c\u8be5\u65b9\u6cd5\u5728\u4f60\u8981\u6392\u9664\u7684\u6587\u4ef6\u6570\u91cf\u8f83\u5c11\uff0c\u5e76\u4e14\u5728\u4f60\u60f3\u8981\u5c06\u5b83\u5199\u6210\u811a\u672c\u6216\u52a0\u5230crontab\u4e2d\u53c8\u4e0d\u60f3\u811a\u672c\u6216cron\u4f9d\u8d56\u4e8e\u53e6\u5916\u4e00\u4e2a\u6587\u4ef6\u8fd0\u884c\u65f6\u5341\u5206\u6709\u7528\u3002<\/p>\n

\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u60f3\u8981\u540c\u6b65\/var\u5230\u4e00\u4e2a\u5907\u4efd\u76ee\u5f55\uff0c\u4f46\u662f\u4f60\u4e0d\u60f3\u8981\u5305\u542bcache\u548ctmp\u8fd9\u4e9b\u901a\u5e38\u4e0d\u4f1a\u6709\u91cd\u8981\u5185\u5bb9\u7684\u6587\u4ef6\u5939\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

$ sudo rsync -aAXhv --exclude={\"\/var\/cache\",\"\/var\/tmp\"} \/var \/home\/adrian\/var<\/pre>\n

\"\"
\n\u8be5\u547d\u4ee4\u6613\u4e8e\u5728\u811a\u672c\u6216cron\u4e2d\u4f7f\u7528\uff0c\u4e5f\u4e0d\u4f1a\u4f9d\u8d56\u5176\u5b83\u6587\u4ef6\u3002\n<\/p>\n

\u4f5c\u8005\uff1aAdrian Dinu \u8bd1\u8005\uff1aGOLinux\u6821\u5bf9\uff1awxy<\/p>\n

\u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7ffb\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-4504-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/rsync-file-list.html<\/a>\u7f16\u8f91\uff1a\u5f20@\u5b87\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb rsync\u662f\u4e00\u4e2a\u5341\u5206\u6709\u7528\uff0c\u800c\u4e14\u5341\u5206\u6d41\u884c\u7684linux\u5de5\u5177\u3002\u5b83\u7528\u4e8e\u5907\u4efd\u548c\u6062\u590d\u6587\u4ef6\uff0c\u4e5f\u7528\u4e8e\u5bf9\u6bd4\u548c\u540c\u6b65\u6587\u4ef6\u3002\u6211\u4eec […]<\/p>\n","protected":false},"author":310,"featured_media":82910,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-82899","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\/82899","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=82899"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/82899\/revisions"}],"predecessor-version":[{"id":286710,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/82899\/revisions\/286710"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/82910"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=82899"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=82899"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=82899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}