{"id":215942,"date":"2021-04-21T08:04:18","date_gmt":"2021-04-21T00:04:18","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=215942"},"modified":"2021-04-16T14:46:07","modified_gmt":"2021-04-16T06:46:07","slug":"linux-anacron","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-anacron.html","title":{"rendered":"\u5982\u4f55\u4f7f\u7528 Linux anacron \u547d\u4ee4"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4e0e\u5176\u624b\u52a8\u6267\u884c\u91cd\u590d\u6027\u7684\u4efb\u52a1\uff0c\u4e0d\u5982\u8ba9 Linux \u4e3a\u4f60\u505a\u3002\u5728 2021 \u5e74\uff0c\u4eba\u4eec\u6709\u66f4\u591a\u7684\u7406\u7531\u559c\u6b22 Linux\u3002\u5728\u8fd9\u4e2a\u7cfb\u5217\u4e2d\uff0c\u6211\u5c06\u5206\u4eab\u4f7f\u7528 Linux \u7684 21 \u4e2a\u4e0d\u540c\u7406\u7531\u3002\u81ea\u52a8\u5316\u662f\u4f7f\u7528 Linux \u7684\u6700\u4f73\u7406\u7531\u4e4b\u4e00\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u6211\u6700\u559c\u6b22 Linux \u7684\u4e00\u4e2a\u539f\u56e0\u662f\u5b83\u613f\u610f\u4e3a\u6211\u505a\u5de5\u4f5c\u3002\u6211\u4e0d\u60f3\u6267\u884c\u91cd\u590d\u6027\u7684\u4efb\u52a1\uff0c\u8fd9\u4e9b\u4efb\u52a1\u4f1a\u5360\u7528\u6211\u7684\u65f6\u95f4\uff0c\u6216\u8005\u5bb9\u6613\u51fa\u9519\uff0c\u6216\u8005\u6211\u53ef\u80fd\u4f1a\u5fd8\u8bb0\uff0c\u6211\u5b89\u6392 Linux \u4e3a\u6211\u505a\u8fd9\u4e9b\u5de5\u4f5c\u3002<\/p>\n

\"\"<\/p>\n

\u4e3a\u81ea\u52a8\u5316\u505a\u51c6\u5907<\/strong><\/div>\n

\u201c\u81ea\u52a8\u5316\u201d\u8fd9\u4e2a\u8bcd\u65e2\u8ba9\u4eba\u671b\u800c\u751f\u754f\uff0c\u53c8\u8ba9\u4eba\u5fc3\u52a8\u3002\u6211\u53d1\u73b0\u7528\u6a21\u5757\u5316\u7684\u65b9\u5f0f\u6765\u5904\u7406\u5b83\u662f\u6709\u5e2e\u52a9\u7684\u3002<\/p>\n

1\u3001\u4f60\u60f3\u5b9e\u73b0\u4ec0\u4e48\uff1f<\/strong><\/span><\/div>\n

\u9996\u5148\uff0c\u8981\u77e5\u9053\u4f60\u60f3\u4ea7\u751f\u4ec0\u4e48\u7ed3\u679c\u3002\u4f60\u662f\u8981\u7ed9\u56fe\u7247\u52a0\u6c34\u5370\u5417\uff1f\u4ece\u6742\u4e71\u7684\u76ee\u5f55\u4e2d\u5220\u9664\u6587\u4ef6\uff1f\u6267\u884c\u91cd\u8981\u6570\u636e\u7684\u5907\u4efd\uff1f\u4e3a\u81ea\u5df1\u660e\u786e\u5b9a\u4e49\u4efb\u52a1\uff0c\u8fd9\u6837\u4f60\u5c31\u77e5\u9053\u81ea\u5df1\u7684\u76ee\u6807\u662f\u4ec0\u4e48\u3002\u5982\u679c\u6709\u4ec0\u4e48\u4efb\u52a1\u662f\u4f60\u53d1\u73b0\u81ea\u5df1\u6bcf\u5929\u90fd\u5728\u505a\u7684\uff0c\u751a\u81f3\u4e00\u5929\u4e00\u6b21\u4ee5\u4e0a\uff0c\u90a3\u4e48\u5b83\u53ef\u80fd\u662f\u81ea\u52a8\u5316\u7684\u5019\u9009\u8005\u3002<\/p>\n

2\u3001\u5b66\u4e60\u4f60\u9700\u8981\u7684\u5e94\u7528<\/strong><\/span><\/div>\n

\u5c06\u5927\u7684\u4efb\u52a1\u5206\u89e3\u6210\u5c0f\u7684\u7ec4\u4ef6\uff0c\u5e76\u5b66\u4e60\u5982\u4f55\u624b\u52a8\u4f46\u4ee5\u53ef\u91cd\u590d\u548c\u53ef\u9884\u6d4b\u7684\u65b9\u5f0f\u4ea7\u751f\u6bcf\u4e2a\u7ed3\u679c\u3002\u5728 Linux \u4e0a\u53ef\u4ee5\u505a\u7684\u5f88\u591a\u4e8b\u60c5\u90fd\u53ef\u4ee5\u7528\u811a\u672c\u6765\u5b8c\u6210\uff0c\u4f46\u91cd\u8981\u7684\u662f\u8981\u8ba4\u8bc6\u5230\u4f60\u5f53\u524d\u7684\u5c40\u9650\u6027\u3002\u5b66\u4e60\u5982\u4f55\u81ea\u52a8\u8c03\u6574\u51e0\u5f20\u56fe\u7247\u7684\u5927\u5c0f\uff0c\u4ee5\u4fbf\u53ef\u4ee5\u65b9\u4fbf\u5730\u901a\u8fc7\u7535\u5b50\u90ae\u4ef6\u53d1\u9001\uff0c\u4e0e\u4f7f\u7528\u673a\u5668\u5b66\u4e60\u4e3a\u4f60\u7684\u6bcf\u5468\u901a\u8baf\u751f\u6210\u7cbe\u5fc3\u5236\u4f5c\u7684\u827a\u672f\u54c1\u4e4b\u95f4\u6709\u5929\u58e4\u4e4b\u522b\u3002\u6709\u7684\u4e8b\u4f60\u53ef\u4ee5\u5728\u4e00\u4e2a\u4e0b\u5348\u5b66\u4f1a\uff0c\u800c\u53e6\u4e00\u4ef6\u4e8b\u53ef\u80fd\u8981\u82b1\u4e0a\u51e0\u5e74\u65f6\u95f4\u3002\u7136\u800c\uff0c\u6211\u4eec\u90fd\u5fc5\u987b\u4ece\u67d0\u4e2a\u5730\u65b9\u5f00\u59cb\uff0c\u6240\u4ee5\u53ea\u8981\u4ece\u5c0f\u505a\u8d77\uff0c\u5e76\u65f6\u523b\u6ce8\u610f\u6539\u8fdb\u7684\u65b9\u6cd5\u3002<\/p>\n

3\u3001\u81ea\u52a8\u5316<\/strong><\/span><\/div>\n

\u5728 Linux \u4e0a\u4f7f\u7528\u4e00\u4e2a\u81ea\u52a8\u5316\u5de5\u5177\u6765\u5b9a\u671f\u5b9e\u73b0\u5b83\u3002\u8fd9\u5c31\u662f\u672c\u6587\u4ecb\u7ecd\u7684\u6b65\u9aa4!
\n\u8981\u60f3\u81ea\u52a8\u5316\u4e00\u4e9b\u4e1c\u897f\uff0c\u4f60\u9700\u8981\u4e00\u4e2a\u811a\u672c\u6765\u81ea\u52a8\u5316\u4e00\u4e2a\u4efb\u52a1\u3002\u5728\u6d4b\u8bd5\u65f6\uff0c\u6700\u597d\u4fdd\u6301\u7b80\u5355\uff0c\u6240\u4ee5\u672c\u6587\u81ea\u52a8\u5316\u7684\u4efb\u52a1\u662f\u5728 \/tmp\u00a0\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u00a0hello\u00a0\u7684\u6587\u4ef6\u3002<\/p>\n

#!\/bin\/sh\r\n\u00a0touch \/tmp\/hello<\/pre>\n

\u5c06\u8fd9\u4e2a\u7b80\u5355\u7684\u811a\u672c\u590d\u5236\u5e76\u7c98\u8d34\u5230\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\u4e2d\uff0c\u5e76\u5c06\u5176\u547d\u540d\u4e3aexample\u3002<\/p>\n

Cron<\/strong><\/div>\n

\u6bcf\u4e2a\u5b89\u88c5\u597d\u7684 Linux \u7cfb\u7edf\u90fd\u4f1a\u6709\u7684\u5185\u7f6e\u81ea\u52a8\u5316\u89e3\u51b3\u65b9\u6848\u5c31\u662f cron \u7cfb\u7edf\u3002Linux \u7528\u6237\u5f80\u5f80\u628a cron \u7b3c\u7edf\u5730\u79f0\u4e3a\u4f60\u7528\u6765\u5b89\u6392\u4efb\u52a1\u7684\u65b9\u6cd5\uff08\u901a\u5e38\u79f0\u4e3a \u201ccron \u4f5c\u4e1a\u201d\uff09\uff0c\u4f46\u6709\u591a\u4e2a\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u63d0\u4f9b cron \u7684\u529f\u80fd\u3002\u6700\u901a\u7528\u7684\u662f\u00a0cronie\uff1b\u5b83\u7684\u4f18\u70b9\u662f\uff0c\u5b83\u4e0d\u4f1a\u50cf\u5386\u53f2\u4e0a\u4e3a\u7cfb\u7edf\u7ba1\u7406\u5458\u8bbe\u8ba1\u7684 cron \u5e94\u7528\u7a0b\u5e8f\u90a3\u6837\uff0c\u5047\u8bbe\u4f60\u7684\u8ba1\u7b97\u673a\u603b\u662f\u5f00\u7740\u3002<\/p>\n

\u9a8c\u8bc1\u4f60\u7684 Linux \u53d1\u884c\u7248\u63d0\u4f9b\u7684\u662f\u54ea\u4e2a cron \u7cfb\u7edf\u3002\u5982\u679c\u4e0d\u662f cronie\uff0c\u4f60\u53ef\u4ee5\u4ece\u53d1\u884c\u7248\u7684\u8f6f\u4ef6\u4ed3\u5e93\u4e2d\u5b89\u88c5 cronie\u3002\u5982\u679c\u4f60\u7684\u53d1\u884c\u7248\u6ca1\u6709 cronie \u7684\u8f6f\u4ef6\u5305\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u65e7\u7684 anacron \u8f6f\u4ef6\u5305\u6765\u4ee3\u66ff\u3002anacron\u00a0\u547d\u4ee4\u662f\u5305\u542b\u5728 cronie \u4e2d\u7684\uff0c\u6240\u4ee5\u4e0d\u7ba1\u4f60\u662f\u5982\u4f55\u83b7\u5f97\u5b83\u7684\uff0c\u4f60\u90fd\u8981\u786e\u4fdd\u5728\u4f60\u7684\u7cfb\u7edf\u4e0a\u6709\u00a0anacron\u00a0\u547d\u4ee4\uff0c\u7136\u540e\u518d\u7ee7\u7eed\u3002anacron \u53ef\u80fd\u9700\u8981\u7ba1\u7406\u5458 root \u6743\u9650\uff0c\u8fd9\u53d6\u51b3\u4e8e\u4f60\u7684\u8bbe\u7f6e\u3002<\/p>\n

$ which anacron\r\n\/usr\/sbin\/anacron\r\n<\/pre>\n

anacron \u7684\u5de5\u4f5c\u662f\u786e\u4fdd\u4f60\u7684\u81ea\u52a8\u5316\u4f5c\u4e1a\u5b9a\u671f\u6267\u884c\u3002\u4e3a\u4e86\u505a\u5230\u8fd9\u4e00\u70b9\uff0canacron \u4f1a\u68c0\u67e5\u627e\u51fa\u6700\u540e\u4e00\u6b21\u8fd0\u884c\u4f5c\u4e1a\u7684\u65f6\u95f4\uff0c\u7136\u540e\u68c0\u67e5\u4f60\u544a\u8bc9\u5b83\u8fd0\u884c\u4f5c\u4e1a\u7684\u9891\u7387\u3002<\/p>\n

\u5047\u8bbe\u4f60\u5c06 anacron \u8bbe\u7f6e\u4e3a\u6bcf\u4e94\u5929\u8fd0\u884c\u4e00\u6b21\u811a\u672c\u3002\u6bcf\u6b21\u4f60\u6253\u5f00\u7535\u8111\u6216\u4ece\u7761\u7720\u4e2d\u5524\u9192\u7535\u8111\u65f6\uff0canacron\u90fd\u4f1a\u626b\u63cf\u5176\u65e5\u5fd7\u4ee5\u786e\u5b9a\u662f\u5426\u9700\u8981\u8fd0\u884c\u4f5c\u4e1a\u3002\u5982\u679c\u4e00\u4e2a\u4f5c\u4e1a\u5728\u4e94\u5929\u6216\u66f4\u4e45\u4e4b\u524d\u8fd0\u884c\uff0c\u90a3\u4e48 anacron \u5c31\u4f1a\u8fd0\u884c\u8be5\u4f5c\u4e1a\u3002<\/p>\n

Cron \u4f5c\u4e1a<\/strong><\/div>\n

\u8bb8\u591a Linux \u7cfb\u7edf\u90fd\u6346\u7ed1\u4e86\u4e00\u4e9b\u7ef4\u62a4\u5de5\u4f5c\uff0c\u8ba9 cron \u6765\u6267\u884c\u3002\u6211\u559c\u6b22\u628a\u6211\u7684\u5de5\u4f5c\u4e0e\u7cfb\u7edf\u5de5\u4f5c\u5206\u5f00\uff0c\u6240\u4ee5\u6211\u5728\u6211\u7684\u4e3b\u76ee\u5f55\u4e2d\u521b\u5efa\u4e86\u4e00\u4e2a\u76ee\u5f55\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u6709\u4e00\u4e2a\u53eb\u505a\u00a0~\/.local\u00a0\u7684\u9690\u85cf\u6587\u4ef6\u5939\uff08\u201clocal\u201d \u7684\u610f\u601d\u662f\u5b83\u662f\u4e3a\u4f60\u7684\u7528\u6237\u8d26\u6237\u5b9a\u5236\u7684\uff0c\u800c\u4e0d\u662f\u4e3a\u4f60\u7684\u201c\u5168\u5c40\u201d\u8ba1\u7b97\u673a\u7cfb\u7edf\u5b9a\u5236\u7684\uff09\uff0c\u6240\u4ee5\u6211\u521b\u5efa\u4e86\u5b50\u76ee\u5f55\u00a0etc\/cron.daily\u00a0\u6765\u4f5c\u4e3a cron \u5728\u6211\u7684\u7cfb\u7edf\u4e0a\u7684\u5bb6\u76ee\u5f55\u3002\u4f60\u8fd8\u5fc5\u987b\u521b\u5efa\u4e00\u4e2a spool \u76ee\u5f55\u6765\u8ddf\u8e2a\u4e0a\u6b21\u8fd0\u884c\u4f5c\u4e1a\u7684\u65f6\u95f4\u3002<\/p>\n

$ mkdir -p ~\/.local\/etc\/cron.daily ~\/.var\/spool\/anacron<\/pre>\n

\u4f60\u53ef\u4ee5\u628a\u4efb\u4f55\u4f60\u60f3\u5b9a\u671f\u8fd0\u884c\u7684\u811a\u672c\u653e\u5230\u00a0~\/.local\/etc\/cron.daily\u00a0\u76ee\u5f55\u4e2d\u3002\u73b0\u5728\u628a\u00a0example\u00a0\u811a\u672c\u590d\u5236\u5230\u76ee\u5f55\u4e2d\uff0c\u7136\u540e\u00a0\u7528 chmod \u547d\u4ee4\u4f7f\u5176\u53ef\u6267\u884c\u3002<\/p>\n

$ cp example ~\/.local\/etc\/cron.daily\r\n# chmod +x ~\/.local\/etc\/cron.daily\/example<\/pre>\n

\u63a5\u4e0b\u6765\uff0c\u8bbe\u7f6e anacron \u6765\u8fd0\u884c\u4f4d\u4e8e\u00a0~\/.local\/etc\/cron.daily\u00a0\u76ee\u5f55\u4e0b\u7684\u4efb\u4f55\u811a\u672c\u3002<\/p>\n

anacron<\/strong><\/div>\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0ccron \u7cfb\u7edf\u7684\u5927\u90e8\u5206\u5185\u5bb9\u90fd\u88ab\u8ba4\u4e3a\u662f\u7cfb\u7edf\u7ba1\u7406\u5458\u7684\u9886\u57df\uff0c\u56e0\u4e3a\u5b83\u901a\u5e38\u7528\u4e8e\u91cd\u8981\u7684\u5e95\u5c42\u4efb\u52a1\uff0c\u5982\u8f6e\u6362\u65e5\u5fd7\u6587\u4ef6\u548c\u66f4\u65b0\u8bc1\u4e66\u3002\u672c\u6587\u6f14\u793a\u7684\u914d\u7f6e\u662f\u4e3a\u666e\u901a\u7528\u6237\u8bbe\u7f6e\u4e2a\u4eba\u81ea\u52a8\u5316\u4efb\u52a1\u800c\u8bbe\u8ba1\u7684\u3002<\/p>\n

\u8981\u914d\u7f6e anacron \u6765\u8fd0\u884c\u4f60\u7684 cron \u4f5c\u4e1a\uff0c\u8bf7\u5728\u00a0\/.local\/etc\/anacrontab\u00a0\u521b\u5efa\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

SHELL=\/bin\/sh\r\nPATH=\/sbin:\/bin:\/usr\/sbin:\/usr\/bin\r\n1 \u00a00 \u00a0cron.mine \u00a0 \u00a0run-parts \/home\/tux\/.local\/etc\/cron.daily\/<\/pre>\n

\u8fd9\u4e2a\u6587\u4ef6\u544a\u8bc9 anacron \u6bcf\u5230\u65b0\u7684\u4e00\u5929\uff08\u4e5f\u5c31\u662f\u6bcf\u65e5\uff09\uff0c\u5ef6\u8fdf 0 \u5206\u949f\u540e\uff0c\u5c31\u8fd0\u884c\uff08run-parts\uff09\u6240\u6709\u5728\u00a0~\/.local\/etc\/cron.daily\u00a0\u4e2d\u627e\u5230\u7684\u53ef\u6267\u884c\u811a\u672c\u3002\u6709\u65f6\uff0c\u4f1a\u4f7f\u7528\u51e0\u5206\u949f\u7684\u5ef6\u8fdf\uff0c\u8fd9\u6837\u4f60\u7684\u8ba1\u7b97\u673a\u5c31\u4e0d\u4f1a\u5728\u4f60\u767b\u5f55\u540e\u5c31\u88ab\u6240\u6709\u53ef\u80fd\u7684\u4efb\u52a1\u51b2\u51fb\u3002\u4e0d\u8fc7\u8fd9\u4e2a\u8bbe\u7f6e\u9002\u5408\u6d4b\u8bd5\u3002<\/p>\n

cron.mine\u00a0\u503c\u662f\u8fdb\u7a0b\u7684\u4e00\u4e2a\u4efb\u610f\u540d\u79f0\u3002\u6211\u79f0\u5b83\u4e3a\u00a0cron.mine\uff0c\u4f46\u4f60\u4e5f\u53ef\u4ee5\u79f0\u5b83\u4e3a\u00a0cron.personal\u00a0\u6216\u00a0penguin\u00a0\u6216\u4efb\u4f55\u4f60\u60f3\u8981\u7684\u540d\u5b57\u3002<\/p>\n

\u9a8c\u8bc1\u4f60\u7684\u00a0anacrontab\u00a0\u6587\u4ef6\u7684\u8bed\u6cd5\uff1a<\/p>\n

$ anacron -T -t ~\/.local\/etc\/anacrontab \\\r\n-S \/home\/tux\/.var\/spool\/anacron<\/pre>\n

\u6c89\u9ed8\u610f\u5473\u7740\u6210\u529f\u3002<\/p>\n

\u5728 .profile \u4e2d\u6dfb\u52a0 anacron<\/strong><\/div>\n

\u6700\u540e\uff0c\u4f60\u5fc5\u987b\u786e\u4fdd anacron \u4ee5\u4f60\u7684\u672c\u5730\u914d\u7f6e\u8fd0\u884c\u3002\u56e0\u4e3a\u4f60\u662f\u4ee5\u666e\u901a\u7528\u6237\u800c\u4e0d\u662f root \u7528\u6237\u7684\u8eab\u4efd\u8fd0\u884c anacron\uff0c\u6240\u4ee5\u4f60\u5fc5\u987b\u5c06\u5b83\u5f15\u5bfc\u5230\u4f60\u7684\u672c\u5730\u914d\u7f6e\uff1a\u544a\u8bc9 anacron \u8981\u505a\u4ec0\u4e48\u7684\u00a0anacrontab\u00a0\u6587\u4ef6\uff0c\u4ee5\u53ca\u5e2e\u52a9 anacron \u8ddf\u8e2a\u6bcf\u4e00\u4e2a\u4f5c\u4e1a\u6700\u540e\u4e00\u6b21\u6267\u884c\u662f\u591a\u5c11\u5929\u7684 spool \u76ee\u5f55\uff1a<\/p>\n

anacron -fn -t \/home\/tux\/.local\/etc\/anacrontab \\\r\n-S \/home\/tux\/.var\/spool\/anacron<\/pre>\n

-fn\u9009\u9879\u544a\u8bc9 anacron\u5ffd\u7565\u65f6\u95f4\u6233\uff0c\u8fd9\u610f\u5473\u7740\u4f60\u5f3a\u8feb\u5b83\u65e0\u8bba\u5982\u4f55\u90fd\u8981\u8fd0\u884c\u4f60\u7684 cron \u4f5c\u4e1a\u3002\u8fd9\u5b8c\u5168\u662f\u4e3a\u4e86\u6d4b\u8bd5\u7684\u76ee\u7684\u3002<\/p>\n

\u6d4b\u8bd5\u4f60\u7684 cron \u4f5c\u4e1a<\/strong><\/div>\n

\u73b0\u5728\u4e00\u5207\u90fd\u8bbe\u7f6e\u597d\u4e86\uff0c\u4f60\u53ef\u4ee5\u6d4b\u8bd5\u4f5c\u4e1a\u4e86\u3002\u4ece\u6280\u672f\u4e0a\u8bb2\uff0c\u4f60\u53ef\u4ee5\u5728\u4e0d\u91cd\u542f\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u6d4b\u8bd5\uff0c\u4f46\u91cd\u542f\u662f\u6700\u6709\u610f\u4e49\u7684\uff0c\u56e0\u4e3a\u8fd9\u5c31\u662f\u8bbe\u8ba1\u7528\u6765\u5904\u7406\u4e2d\u65ad\u548c\u4e0d\u89c4\u5219\u7684\u767b\u5f55\u4f1a\u8bdd\u7684\u3002\u82b1\u70b9\u65f6\u95f4\u91cd\u542f\u7535\u8111\u3001\u767b\u5f55\uff0c\u7136\u540e\u5bfb\u627e\u6d4b\u8bd5\u6587\u4ef6\uff1a<\/p>\n

$ ls \/tmp\/hello\r\n\/tmp\/hello<\/pre>\n

\u5047\u8bbe\u6587\u4ef6\u5b58\u5728\uff0c\u90a3\u4e48\u4f60\u7684\u793a\u4f8b\u811a\u672c\u5df2\u7ecf\u6210\u529f\u6267\u884c\u3002\u73b0\u5728\u4f60\u53ef\u4ee5\u4ece ~\/.profile\u00a0\u4e2d\u5220\u9664\u6d4b\u8bd5\u9009\u9879\uff0c\u7559\u4e0b\u8fd9\u4e2a\u4f5c\u4e3a\u4f60\u7684\u6700\u7ec8\u914d\u7f6e\u3002<\/p>\n

anacron -t \/home\/tux\/.local\/etc\/anacrontab \\\r\n-S \/home\/tux\/.var\/spool\/anacron<\/pre>\n
\u4f7f\u7528 anacron<\/strong><\/div>\n

\u4f60\u5df2\u7ecf\u914d\u7f6e\u597d\u4e86\u4f60\u7684\u4e2a\u4eba\u81ea\u52a8\u5316\u57fa\u7840\u8bbe\u65bd\uff0c\u6240\u4ee5\u4f60\u53ef\u4ee5\u628a\u4efb\u4f55\u4f60\u60f3\u8ba9\u4f60\u7684\u8ba1\u7b97\u673a\u66ff\u4f60\u7ba1\u7406\u7684\u811a\u672c\u653e\u5230\u00a0~\/.local\/etc\/cron.daily\u00a0\u76ee\u5f55\u4e0b\uff0c\u5b83\u5c31\u4f1a\u6309\u8ba1\u5212\u8fd0\u884c\u3002<\/p>\n

\u8fd9\u53d6\u51b3\u4e8e\u4f60\u5e0c\u671b\u4f5c\u4e1a\u8fd0\u884c\u7684\u9891\u7387\u3002\u793a\u4f8b\u811a\u672c\u662f\u6bcf\u5929\u6267\u884c\u4e00\u6b21\u3002\u5f88\u660e\u663e\uff0c\u8fd9\u53d6\u51b3\u4e8e\u4f60\u7684\u8ba1\u7b97\u673a\u5728\u4efb\u4f55\u4e00\u5929\u662f\u5426\u5f00\u673a\u548c\u9192\u7740\u3002\u5982\u679c\u4f60\u5728\u5468\u4e94\u4f7f\u7528\u7535\u8111\uff0c\u4f46\u628a\u5b83\u8bbe\u7f6e\u5728\u5468\u672b\uff0c\u811a\u672c\u5c31\u4e0d\u4f1a\u5728\u5468\u516d\u548c\u5468\u65e5\u8fd0\u884c\u3002\u7136\u800c\uff0c\u5728\u5468\u4e00\uff0c\u811a\u672c\u4f1a\u6267\u884c\uff0c\u56e0\u4e3a anacron \u4f1a\u77e5\u9053\u81f3\u5c11\u6709\u4e00\u5929\u5df2\u7ecf\u8fc7\u53bb\u4e86\u3002\u4f60\u53ef\u4ee5\u5728\u00a0~\/.local\/etc\u00a0\u4e2d\u6dfb\u52a0\u6bcf\u5468\u3001\u6bcf\u4e24\u5468\u3001\u751a\u81f3\u6bcf\u6708\u7684\u76ee\u5f55\uff0c\u4ee5\u5b89\u6392\u5404\u79cd\u5404\u6837\u7684\u95f4\u9694\u3002<\/p>\n

\u8981\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u65f6\u95f4\u95f4\u9694\uff1a<\/p>\n

\u5728\u00a0~\/.local\/etc\u00a0\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u76ee\u5f55\uff08\u4f8b\u5982\u00a0cron.weekly\uff09\u3002\r\n\u5728\u00a0~\/.local\/etc\/anacrontab\u00a0\u4e2d\u6dfb\u52a0\u4e00\u884c\uff0c\u4ee5\u4fbf\u5728\u65b0\u76ee\u5f55\u4e0b\u8fd0\u884c\u811a\u672c\u3002\u5bf9\u4e8e\u6bcf\u5468\u4e00\u6b21\u7684\u95f4\u9694\uff0c\u5176\u914d\u7f6e\u5982\u4e0b\u30027 0 cron.mine run-parts \/home\/tux\/.local\/etc\/cron.weekly\/\uff080\u00a0\u7684\u503c\u53ef\u4ee5\u9009\u62e9\u4e00\u4e9b\u5206\u949f\u6570\uff0c\u4ee5\u9002\u5f53\u5730\u5ef6\u8fdf\u811a\u672c\u7684\u542f\u52a8\uff09\u3002\r\n\u628a\u4f60\u7684\u811a\u672c\u653e\u5728\u00a0cron.weekly\u00a0\u76ee\u5f55\u4e0b\u3002<\/pre>\n

\u6b22\u8fce\u6765\u5230\u81ea\u52a8\u5316\u7684\u751f\u6d3b\u65b9\u5f0f\u3002\u5b83\u4e0d\u4f1a\u8ba9\u4eba\u611f\u89c9\u5230\uff0c\u4f46\u4f60\u5c06\u4f1a\u53d8\u5f97\u66f4\u6709\u6548\u7387\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6211\u6700\u559c\u6b22 Linux \u7684\u4e00\u4e2a\u539f\u56e0\u662f\u5b83\u613f\u610f\u4e3a\u6211\u505a\u5de5\u4f5c\u3002\u6211\u4e0d\u60f3\u6267\u884c\u91cd\u590d\u6027\u7684\u4efb\u52a1\uff0c\u8fd9\u4e9b\u4efb\u52a1\u4f1a\u5360\u7528\u6211\u7684\u65f6\u95f4\uff0c\u6216\u8005\u5bb9\u6613\u51fa […]<\/p>\n","protected":false},"author":323,"featured_media":202541,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-215942","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\/215942","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\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=215942"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/215942\/revisions"}],"predecessor-version":[{"id":215948,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/215942\/revisions\/215948"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/202541"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=215942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=215942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=215942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}