{"id":259,"date":"2007-10-06T00:00:00","date_gmt":"2007-10-06T00:00:00","guid":{"rendered":"http:\/\/www.strongd.net\/?p=259"},"modified":"2007-10-06T00:00:00","modified_gmt":"2007-10-06T00:00:00","slug":"Linux \u6280\u5de7: \u7528 cron \u548c at \u8c03\u5ea6\u4f5c\u4e1a","status":"publish","type":"post","link":"https:\/\/www.strongd.net\/?p=259","title":{"rendered":"Linux \u6280\u5de7: \u7528 cron \u548c at \u8c03\u5ea6\u4f5c\u4e1a"},"content":{"rendered":"<p><H1><FONT size=5><SPAN style=\"COLOR: #999999\">Linux \u6280\u5de7: <\/SPAN>\u7528 cron \u548c at \u8c03\u5ea6\u4f5c\u4e1a<\/FONT><\/H1><br \/>\n<P id=subtitle>\u5982\u4f55\u8f7b\u677e\u5730\u7ba1\u7406\u7cfb\u7edf<\/P><br \/>\n<DIV><br \/>\n<P>2007 \u5e74 8 \u6708 27 \u65e5<\/P><br \/>\n<BLOCKQUOTE>\u7cfb\u7edf\u7ba1\u7406\u5458\u9700\u8981\u5728\u7cfb\u7edf\u8d1f\u8f7d\u4f4e\u7684\u5348\u591c\u8fd0\u884c\u4f5c\u4e1a\uff0c\u6216\u8005\u9700\u8981\u6bcf\u5929\u6216\u6bcf\u6708\u8fd0\u884c\u4f5c\u4e1a\uff0c\u540c\u65f6\u53c8\u4e0d\u613f\u610f\u727a\u7272\u7761\u7720\u65f6\u95f4\u6216\u5047\u671f\u3002\u8c03\u5ea6\u4efb\u52a1\u7684\u5176\u4ed6\u539f\u56e0\u5305\u62ec\u81ea\u52a8\u6267\u884c\u65e5\u5e38\u4efb\u52a1\u6216\u8005\u786e\u4fdd\u6bcf\u6b21\u90fd\u4ee5\u76f8\u540c\u7684\u65b9\u5f0f\u5904\u7406\u4efb\u52a1\u3002\u672c\u6587\u5e2e\u52a9\u60a8\u4f7f\u7528 <CODE>cron<\/CODE> \u548c <CODE>at<\/CODE> \u529f\u80fd\u8c03\u5ea6\u4f5c\u4e1a\u5b9a\u671f\u8fd0\u884c\u6216\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u8fd0\u884c\u4e00\u6b21\u3002<\/BLOCKQUOTE><!--START RESERVED FOR FUTURE USE INCLUDE FILES--><!-- include java script once we verify teams wants to use this and it will work on dbcs and cyrillic characters --><!--END RESERVED FOR FUTURE USE INCLUDE FILES--><br \/>\n<P>Linux\u00ae \u548c UNIX\u00ae \u7cfb\u7edf\u5141\u8bb8\u8c03\u5ea6\u4efb\u52a1\u5728\u4ee5\u540e\u6267\u884c\u4e00\u6b21\uff0c\u6216\u8005\u91cd\u590d\u8fd0\u884c\u3002\u672c\u6587\u662f\u4ece developerWorks \u6559\u7a0b \u201c<A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/edu\/l-dw-l-lpi1111.html\"><FONT color=#5c81a7>LPI 102 \u8003\u8bd5\u51c6\u5907\uff1a\u7ba1\u7406\u4efb\u52a1<\/FONT><\/A>\u201d \u6458\u5f55\u7684\uff0c\u8bb2\u89e3\u5982\u4f55\u8c03\u5ea6\u4f5c\u4e1a\u5b9a\u671f\u8fd0\u884c\uff0c\u6216\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u8fd0\u884c\u4e00\u6b21\u3002<\/P><br \/>\n<P>\u5728 Linux \u7cfb\u7edf\u4e0a\uff0c\u8bb8\u591a\u7ba1\u7406\u4efb\u52a1\u5fc5\u987b\u9891\u7e41\u5730\u5b9a\u671f\u6267\u884c\u3002\u8fd9\u4e9b\u4efb\u52a1\u5305\u62ec\u8f6e\u8f6c\u65e5\u5fd7\u6587\u4ef6\u4ee5\u907f\u514d\u88c5\u6ee1\u6587\u4ef6\u7cfb\u7edf\u3001\u5907\u4efd\u6570\u636e\u548c\u8fde\u63a5\u65f6\u95f4\u670d\u52a1\u5668\u6765\u6267\u884c\u7cfb\u7edf\u65f6\u95f4\u540c\u6b65\u3002\u4e0a\u9762\u63d0\u5230\u7684\u6559\u7a0b\u66f4\u8be6\u7ec6\u5730\u4ecb\u7ecd\u4e86\u8fd9\u4e9b\u7ba1\u7406\u4efb\u52a1\u3002\u5728\u672c\u6587\u4e2d\uff0c\u5b66\u4e60 Linux \u4e2d\u63d0\u4f9b\u7684\u8c03\u5ea6\u673a\u5236\uff0c\u5305\u62ec <CODE>cron<\/CODE> \u548c <CODE>anacron<\/CODE> \u8bbe\u65bd\u4ee5\u53ca <CODE>crontab<\/CODE> \u548c <CODE>at<\/CODE> \u547d\u4ee4\u3002\u5373\u4f7f\u7cfb\u7edf\u5e38\u5e38\u5173\u673a\uff0c<CODE>anacron<\/CODE> \u4e5f\u53ef\u4ee5\u5e2e\u52a9\u8c03\u5ea6\u4f5c\u4e1a\u3002 <\/P><br \/>\n<P><A name=N10093><SPAN class=atitle>\u4ee5\u4e00\u5b9a\u7684\u65f6\u95f4\u95f4\u9694\u8fd0\u884c\u4f5c\u4e1a<\/SPAN><\/A><\/P><br \/>\n<P>\u4ee5\u4e00\u5b9a\u7684\u65f6\u95f4\u95f4\u9694\u8fd0\u884c\u4f5c\u4e1a\u9700\u8981\u4f7f\u7528 <I>cron<\/I> \u8bbe\u65bd\u8fdb\u884c\u7ba1\u7406\uff0c\u5b83\u7531 <CODE>crond<\/CODE> \u5b88\u62a4\u8fdb\u7a0b\u548c\u4e00\u7ec4\u8868\uff08\u63cf\u8ff0\u6267\u884c\u54ea\u4e9b\u64cd\u4f5c\u548c\u91c7\u7528\u4ec0\u4e48\u6837\u7684\u9891\u7387\uff09\u7ec4\u6210\u3002\u8fd9\u4e2a\u5b88\u62a4\u8fdb\u7a0b\u6bcf\u5206\u949f\u5524\u9192\u4e00\u6b21\uff0c\u5e76\u901a\u8fc7\u68c0\u67e5 crontab \u5224\u65ad\u9700\u8981\u505a\u4ec0\u4e48\u3002\u7528\u6237\u4f7f\u7528 <CODE>crontab<\/CODE> \u547d\u4ee4\u7ba1\u7406 crontab\u3002<CODE>crond<\/CODE> \u5b88\u62a4\u8fdb\u7a0b\u5e38\u5e38\u662f\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u7531 init \u8fdb\u7a0b\u542f\u52a8\u7684\u3002<\/P><br \/>\n<P>\u4e3a\u4e86\u7b80\u5355\uff0c\u5047\u8bbe\u5e0c\u671b\u5b9a\u671f\u8fd0\u884c\u6e05\u5355 1 \u6240\u793a\u7684\u547d\u4ee4\u3002\u8fd9\u4e2a\u547d\u4ee4\u5b9e\u9645\u4e0a\u53ea\u62a5\u544a\u65e5\u671f\u548c\u65f6\u95f4\uff0c\u5176\u4ed6\u4ec0\u4e48\u4e8b\u90fd\u4e0d\u505a\uff0c\u4f46\u662f\u5b83\u53ef\u4ee5\u8bf4\u660e\u5982\u4f55\u4f7f\u7528 <CODE>crontab<\/CODE> \u8bbe\u7f6e cron \u4f5c\u4e1a\uff0c\u800c\u4e14\u8fd8\u53ef\u4ee5\u901a\u8fc7\u8f93\u51fa\u770b\u5230\u4f5c\u4e1a\u8fd0\u884c\u7684\u65f6\u95f4\u3002\u8bbe\u7f6e crontab \u6761\u76ee\u9700\u8981\u4e00\u4e2a\u5305\u542b\u8f6c\u4e49\u7684 shell \u5143\u5b57\u7b26\u7684\u5b57\u7b26\u4e32\uff0c\u6240\u4ee5\u9002\u5408\u4e8e\u7b80\u5355\u7684\u547d\u4ee4\u548c\u53c2\u6570\u3002\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u5c06\u4ece\u811a\u672c \/home\/ian\/mycrontab.sh \u8fd0\u884c <CODE>echo<\/CODE> \u547d\u4ee4\uff0c\u8fd9\u4e2a\u811a\u672c\u4e0d\u9700\u8981\u53c2\u6570\u3002 \u8fd9\u53ef\u4ee5\u51cf\u5c11\u5904\u7406\u8f6c\u4e49\u5b57\u7b26\u7684\u5de5\u4f5c\u3002<\/P><BR><A name=simplecmd><B>\u6e05\u5355 1. \u4e00\u4e2a\u7b80\u5355\u7684\u547d\u4ee4\u793a\u4f8b<\/B><\/A><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"80%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD class=code-outline><PRE class=displaycode><br \/>\n[ian@lyrebird ~]$ cat mycrontest.sh<br \/>\n#!\/bin\/bash<br \/>\n echo &#8220;It is now $(date +%T) on $(date +%A)&#8221;<br \/>\n[ian@lyrebird ~]$ .\/mycrontest.sh<br \/>\nIt is now 18:37:42 on Friday<br \/>\n<\/PRE><\/TD><\/TR><\/TBODY><\/TABLE><BR><br \/>\n<P><A name=N100C1><SPAN class=smalltitle><STRONG><FONT size=3>\u521b\u5efa crontab<\/FONT><\/STRONG><\/SPAN><\/A><\/P><br \/>\n<P>\u4f7f\u7528 <CODE>crontab<\/CODE> \u547d\u4ee4\u548c <CODE>-e<\/CODE>\uff08\u8868\u793a \u201cedit\u201d\uff09\u9009\u9879\u521b\u5efa crontab\u3002\u8fd9\u4f1a\u6253\u5f00 <CODE>vi<\/CODE> \u7f16\u8f91\u5668\uff0c\u9664\u975e\u5728 EDITOR \u6216 VISUAL \u73af\u5883\u53d8\u91cf\u4e2d\u6307\u5b9a\u4e86\u53e6\u4e00\u79cd\u7f16\u8f91\u5668\u3002 <\/P><br \/>\n<P>\u6bcf\u4e2a crontab \u6761\u76ee\u5305\u542b\u516d\u4e2a\u5b57\u6bb5\uff1a<\/P><br \/>\n<OL><br \/>\n<LI>\u5206\u949f<br \/>\n<LI>\u5c0f\u65f6<br \/>\n<LI>\u65e5<br \/>\n<LI>\u6708<br \/>\n<LI>\u661f\u671f<br \/>\n<LI>\u7531 <CODE>sh<\/CODE> \u6267\u884c\u7684\u5b57\u7b26\u4e32 <\/LI><\/OL><br \/>\n<P>\u5206\u949f\u548c\u5c0f\u65f6\u7684\u8303\u56f4\u5206\u522b\u662f 0-59 \u548c 0-12\uff0c\u65e5\u548c\u6708\u7684\u8303\u56f4\u5206\u522b\u662f 1-31 \u548c 1-12\u3002\u661f\u671f\u7684\u8303\u56f4\u662f 0-6\uff0c0 \u8868\u793a\u661f\u671f\u65e5\u3002\u661f\u671f\u4e5f\u53ef\u4ee5\u6307\u5b9a\u4e3a sun\u3001mon\u3001tue \u7b49\u7b49\u3002\u7b2c 6 \u4e2a\u5b57\u6bb5\u5305\u542b\u524d 5 \u4e2a\u5b57\u6bb5\u4e4b\u540e\u7684\u6240\u6709\u5185\u5bb9\uff0c\u5b83\u662f\u8981\u4f20\u9012\u7ed9 <CODE>sh<\/CODE> \u7684\u5b57\u7b26\u4e32\u3002\u767e\u5206\u53f7\uff08%\uff09\u5c06\u8f6c\u6362\u4e3a\u7a7a\u884c\uff0c\u6240\u4ee5\u5982\u679c\u8981\u4f7f\u7528 % \u6216\u5176\u4ed6\u4efb\u4f55\u7279\u6b8a\u5b57\u7b26\uff0c\u5c31\u8981\u5728\u524d\u9762\u52a0\u4e0a\u53cd\u659c\u7ebf\uff08\\\uff09\u3002\u7b2c\u4e00\u4e2a % \u4e4b\u524d\u7684\u4e00\u884c\u4f20\u9012\u7ed9 shell\uff0c\u8fd9\u4e2a % \u4e4b\u540e\u7684\u6240\u6709\u884c\u90fd\u4f5c\u4e3a\u6807\u51c6\u8f93\u5165\u4f20\u9012\u3002<\/P><br \/>\n<P>\u5404\u4e2a\u4e0e\u65f6\u95f4\u76f8\u5173\u7684\u5b57\u6bb5\u53ef\u4ee5\u6307\u5b9a\u4e00\u4e2a\u5355\u72ec\u7684\u503c\u3001\u503c\u7684\u8303\u56f4\uff08\u6bd4\u5982 0-10 \u6216 sun-wed\uff09\u6216\u8005\u4ee5\u9017\u53f7\u5206\u9694\u7684\u5355\u72ec\u503c\u548c\u8303\u56f4\u5217\u8868\u3002\u6e05\u5355 2 \u7ed9\u51fa\u4e00\u4e2a crontab \u6761\u76ee\u793a\u4f8b\u3002<\/P><BR><A name=N100FF><B>\u6e05\u5355 2. \u4e00\u4e2a\u7b80\u5355\u7684 crontab \u793a\u4f8b<\/B><\/A><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"80%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD class=code-outline><PRE class=displaycode><br \/>\n0,20,40 22-23 * 7 fri-sat \/home\/ian\/mycrontest.sh<br \/>\n<\/PRE><\/TD><\/TR><\/TBODY><\/TABLE><BR><br \/>\n<P>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u6211\u4eec\u7684\u547d\u4ee4\u5728 7 \u6708\u7684\u6bcf\u4e2a\u661f\u671f\u4e94\u548c\u661f\u671f\u516d\u665a\u4e0a 10 \u70b9\u5230\u5348\u591c\u4e4b\u95f4\u7684\u7b2c 0\u300120\u300140 \u5206\u949f\uff08\u6bcf 20 \u5206\u949f\uff09\u6267\u884c\u3002\u5173\u4e8e\u6307\u5b9a\u65f6\u95f4\u7684\u5176\u4ed6\u65b9\u5f0f\u7684\u7ec6\u8282\uff0c\u53c2\u89c1 crontab(5) \u7684\u624b\u518c\u9875\u3002<\/P><br \/>\n<P><A name=N10108><SPAN class=smalltitle><STRONG><FONT size=3>\u8f93\u51fa<\/FONT><\/STRONG><\/SPAN><\/A><\/P><br \/>\n<P>\u60a8\u53ef\u80fd\u60f3\u77e5\u9053\u5bf9\u6765\u81ea\u547d\u4ee4\u7684\u8f93\u51fa\u4f1a\u5982\u4f55\u5904\u7406\u3002\u4e3a\u4f7f\u7528 cron \u800c\u8bbe\u8ba1\u7684\u5927\u591a\u6570\u547d\u4ee4\u4f1a\u4f7f\u7528 syslog \u5728\u65e5\u5fd7\u4e2d\u8bb0\u5f55\u8f93\u51fa\uff08\u53c2\u89c1\u6559\u7a0b \u201c<A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/edu\/l-dw-l-lpi1111.html\"><FONT color=#5c81a7>LPI 102 \u8003\u8bd5\u51c6\u5907\uff1a\u7ba1\u7406\u4efb\u52a1<\/FONT><\/A>\u201d \u4e2d\u7684\u8ba8\u8bba\uff09\u3002\u4f46\u662f\uff0c\u5b9a\u5411\u5230 stdout \u7684\u8f93\u51fa\u4f1a\u901a\u8fc7\u7535\u5b50\u90ae\u4ef6\u53d1\u9001\u7ed9\u7528\u6237\u3002\u6e05\u5355 3 \u7ed9\u51fa\u6211\u4eec\u7684\u547d\u4ee4\u793a\u4f8b\u53ef\u80fd\u4ea7\u751f\u7684\u8f93\u51fa\u3002 <\/P><BR><A name=N10118><B>\u6e05\u5355 3. \u901a\u8fc7\u7535\u5b50\u90ae\u4ef6\u53d1\u9001\u7684 cron \u8f93\u51fa<\/B><\/A><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"80%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD class=code-outline><PRE class=displaycode><br \/>\nFrom ian@lyrebird.raleigh.ibm.com  Fri Jul  6 23:00:02 2007<br \/>\nDate: Fri, 6 Jul 2007 23:00:01 -0400<br \/>\nFrom: root@lyrebird.raleigh.ibm.com (Cron Daemon)<br \/>\nTo: ian@lyrebird.raleigh.ibm.com<br \/>\nSubject: Cron &lt;ian@lyrebird&gt; \/home\/ian\/mycrontest.sh<br \/>\nContent-Type: text\/plain; charset=UTF-8<br \/>\nAuto-Submitted: auto-generated<br \/>\nX-Cron-Env: &lt;SHELL=\/bin\/sh&gt;<br \/>\nX-Cron-Env: &lt;HOME=\/home\/ian&gt;<br \/>\nX-Cron-Env: &lt;PATH=\/usr\/bin:\/bin&gt;<br \/>\nX-Cron-Env: &lt;LOGNAME=ian&gt;<br \/>\nX-Cron-Env: &lt;USER=ian&gt;<\/p>\n<p>It is now 23:00:01 on Friday<\/p>\n<p><\/PRE><\/TD><\/TR><\/TBODY><\/TABLE><BR><br \/>\n<P><A name=N1011E><SPAN class=smalltitle><STRONG><FONT size=3>crontab \u5b58\u50a8\u5728\u54ea\u91cc\uff1f<\/FONT><\/STRONG><\/SPAN><\/A><\/P><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"50%\" align=right border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=10><STRONG><IMG height=1 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=10><\/STRONG><\/TD><br \/>\n<TD><br \/>\n<TABLE cellSpacing=0 cellPadding=5 width=\"100%\" border=1><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD bgColor=#eeeeee><A name=N10126><STRONG>suid \u7a0b\u5e8f<\/STRONG><\/A><BR><br \/>\n<P>suid \u7a0b\u5e8f\u4ee5\u7a0b\u5e8f\u6587\u4ef6\u7684\u6240\u6709\u8005\u7684\u6743\u9650\u8fd0\u884c\uff0c\u800c\u4e0d\u662f\u91c7\u7528\u8fd0\u884c\u7a0b\u5e8f\u7684\u7528\u6237\u7684\u6743\u9650\u3002\u5173\u4e8e <CODE>suid<\/CODE> \u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u6559\u7a0b \u201c<A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/views\/linux\/tutorials.jsp?cv_doc_id=102617\"><FONT color=#5c81a7>LPI 101 \u8003\u8bd5\u51c6\u5907\uff1a\u8bbe\u5907\u3001Linux \u6587\u4ef6\u7cfb\u7edf\u548c Filesystem Hierarchy Standard<\/FONT><\/A>\u201d\uff1b\u5173\u4e8e <CODE>passwd<\/CODE> \u547d\u4ee4\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u6559\u7a0b \u201c<A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/edu\/l-dw-l-lpi1111.html\"><FONT color=#5c81a7>LPI 102 \u8003\u8bd5\u51c6\u5907\uff1a\u7ba1\u7406\u4efb\u52a1<\/FONT><\/A>\u201d\u3002<\/P><\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR><\/TBODY><\/TABLE><br \/>\n<P>\u7528 <CODE>crontab<\/CODE> \u547d\u4ee4\u521b\u5efa\u7684 crontab \u5b58\u50a8\u5728 \/etc\/spool\/cron \u4e0b\u9762\u7684\u4e00\u4e2a\u5b50\u76ee\u5f55\u4e2d\uff0c\u8fd9\u4e2a\u5b50\u76ee\u5f55\u4e0e\u521b\u5efa crontab \u7684\u7528\u6237\u540c\u540d\uff0c\u6240\u4ee5\u4e0a\u9762\u7684 crontab \u5b58\u50a8\u5728 \/etc\/spool\/cron\/ian \u4e2d\u3002\u56e0\u6b64\uff0c\u4e0e <CODE>passwd<\/CODE> \u547d\u4ee4\u4e00\u6837\uff0c<CODE>crontab<\/CODE> \u547d\u4ee4\u662f\u4e00\u4e2a\u7528\u6839\u6743\u9650\u8fd0\u884c\u7684 suid \u7a0b\u5e8f\u3002 <\/P><br \/>\n<P><A name=N10150><SPAN class=smalltitle><STRONG><FONT size=3>\/etc\/crontab<\/FONT><\/STRONG><\/SPAN><\/A><\/P><br \/>\n<P>\u9664\u4e86 \/var\/spool\/cron \u4e2d\u7684\u7528\u6237 crontab \u6587\u4ef6\u4e4b\u5916\uff0c<CODE>cron<\/CODE> \u8fd8\u4f1a\u68c0\u67e5 \/etc\/crontab \u6587\u4ef6\u548c \/etc\/cron.d \u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u3002\u5728\u8fd9\u4e9b\u7cfb\u7edf crontab \u4e2d\uff0c\u5728\u7b2c\u4e94\u4e2a\u65f6\u95f4\u5b57\u6bb5\uff08\u661f\u671f\uff09\u548c\u547d\u4ee4\u4e4b\u95f4\u589e\u52a0\u4e86\u4e00\u4e2a\u5b57\u6bb5\u3002\u8fd9\u4e2a\u5b57\u6bb5\u6307\u5b9a\u54ea\u4e2a\u7528\u6237\u5e94\u8be5\u8fd0\u884c\u8fd9\u4e2a\u547d\u4ee4\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\u662f\u6839\u7528\u6237\u3002\u6e05\u5355 4 \u7ed9\u51fa\u4e00\u4e2a \/etc\/crontab \u6587\u4ef6\u793a\u4f8b\u3002<\/P><BR><A name=N10160><B>\u6e05\u5355 4. \/etc\/crontab<\/B><\/A><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"80%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD class=code-outline><PRE class=displaycode><br \/>\nSHELL=\/bin\/bash<br \/>\nPATH=\/sbin:\/bin:\/usr\/sbin:\/usr\/bin<br \/>\nMAILTO=root<br \/>\nHOME=\/<\/p>\n<p># run-parts<br \/>\n01 * * * * root run-parts \/etc\/cron.hourly<br \/>\n02 4 * * * root run-parts \/etc\/cron.daily<br \/>\n22 4 * * 0 root run-parts \/etc\/cron.weekly<br \/>\n42 4 1 * * root run-parts \/etc\/cron.monthly<br \/>\n      <\/PRE><\/TD><\/TR><\/TBODY><\/TABLE><BR><br \/>\n<P>\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u771f\u6b63\u7684\u5de5\u4f5c\u7531 <CODE>run-parts<\/CODE> \u547d\u4ee4\u6267\u884c\uff0c\u5b83\u8fd0\u884c \/etc\/cron.hourly\u3001\/etc\/cron.daily \u7b49\u76ee\u5f55\u4e2d\u7684\u811a\u672c\uff1b\/etc\/crontab \u4ec5\u4ec5\u63a7\u5236\u6267\u884c\u4f5c\u4e1a\u7684\u65f6\u95f4\u3002\u6ce8\u610f\uff0c\u8fd9\u91cc\u7684\u6240\u6709\u547d\u4ee4\u90fd\u4f5c\u4e3a\u6839\u7528\u6237\u8fd0\u884c\u3002\u8fd8\u8981\u6ce8\u610f\uff0ccrontab \u53ef\u4ee5\u5305\u542b shell \u53d8\u91cf\u8d4b\u503c\uff0c\u8fd9\u4e9b\u8d4b\u503c\u4f1a\u5728\u8fd0\u884c\u547d\u4ee4\u4e4b\u524d\u6267\u884c\u3002 <\/P><br \/>\n<P><A name=N1016D><SPAN class=smalltitle><STRONG><FONT size=3>anacron<\/FONT><\/STRONG><\/SPAN><\/A><\/P><br \/>\n<P>cron \u9002\u5408\u90a3\u4e9b\u8fde\u7eed\u8fd0\u884c\u7684\u7cfb\u7edf\u3002\u5bf9\u4e8e\u90a3\u4e9b\u5e38\u5e38\u4e0d\u5f00\u673a\u7684\u7cfb\u7edf\uff0c\u6bd4\u5982\u7b14\u8bb0\u672c\u8ba1\u7b97\u673a\uff0c\u53ef\u4ee5\u4f7f\u7528\u53e6\u4e00\u4e2a\u5b9e\u7528\u7a0b\u5e8f <I>anacron<\/I>\uff08\u8868\u793a \u201canachronistic cron\u201d\uff09\u8c03\u5ea6\u6bcf\u65e5\u3001\u6bcf\u5468\u6216\u6bcf\u6708\u6267\u884c\u7684\u4f5c\u4e1a\u3002anacron \u4e0d\u5904\u7406\u6bcf\u5c0f\u65f6\u6267\u884c\u7684\u4f5c\u4e1a\u3002<\/P><br \/>\n<P>anacron \u5728 \/var\/spool\/anacron \u4e2d\u4fdd\u7559\u65f6\u95f4\u6233\u6587\u4ef6\uff0c\u8bb0\u5f55\u4f5c\u4e1a\u8fd0\u884c\u7684\u65f6\u95f4\u3002\u5f53 anacron \u8fd0\u884c\u65f6\uff0c\u5b83\u68c0\u67e5\u81ea\u4f5c\u4e1a\u4e0a\u4e00\u6b21\u8fd0\u884c\u4ee5\u6765\u662f\u5426\u5df2\u7ecf\u7ecf\u8fc7\u4e86\u6240\u9700\u7684\u5929\u6570\uff0c\u5982\u679c\u9700\u8981\uff0c\u5c31\u8fd0\u884c\u4f5c\u4e1a\u3002anacron \u7684\u4f5c\u4e1a\u8868\u5b58\u50a8\u5728 \/etc\/anacrontab \u4e2d\uff0c\u6587\u4ef6\u683c\u5f0f\u4e0e \/etc\/crontab \u7565\u6709\u4e0d\u540c\u3002\u4e0e \/etc\/crontab \u4e00\u6837\uff0c\/etc\/anacrontab \u53ef\u4ee5\u5305\u542b\u73af\u5883\u8bbe\u7f6e\u3002\u6bcf\u4e2a\u4f5c\u4e1a\u6709\u56db\u4e2a\u5b57\u6bb5\uff1a<\/P><br \/>\n<OL><br \/>\n<LI>\u5468\u671f<br \/>\n<LI>\u5ef6\u8fdf<br \/>\n<LI>\u4f5c\u4e1a\u6807\u8bc6\u7b26<br \/>\n<LI>\u547d\u4ee4 <\/LI><\/OL><br \/>\n<P>\u5468\u671f\u662f\u5929\u6570\uff0c\u4f46\u662f\u53ef\u4ee5\u6307\u5b9a\u4e3a @monthly\uff0c\u8fd9\u786e\u4fdd\u4f5c\u4e1a\u6bcf\u4e2a\u6708\u53ea\u8fd0\u884c\u4e00\u6b21\uff08\u65e0\u8bba\u8fd9\u4e2a\u6708\u4e2d\u6709\u591a\u5c11\u5929\uff09\u3002\u5ef6\u8fdf\u662f\u5728\u4f5c\u4e1a\u7b26\u5408\u8fd0\u884c\u6761\u4ef6\u4e4b\u540e\uff0c\u5230\u5b9e\u9645\u542f\u52a8\u5b83\u4e4b\u524d\u7b49\u5f85\u7684\u5206\u949f\u6570\u3002\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2a\u8bbe\u7f6e\u9632\u6b62\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u96c6\u4e2d\u6267\u884c\u4f5c\u4e1a\u3002\u4f5c\u4e1a\u6807\u8bc6\u7b26\u53ef\u4ee5\u5305\u542b\u9664\u4e86\u659c\u7ebf\uff08\/\uff09\u4e4b\u5916\u7684\u6240\u6709\u975e\u7a7a\u767d\u5b57\u7b26\u3002 <\/P><br \/>\n<P>\/etc\/crontab \u548c \/etc\/anacrontab \u90fd\u901a\u8fc7\u76f4\u63a5\u7f16\u8f91\u8fdb\u884c\u66f4\u65b0\u3002\u4e0d\u4f7f\u7528 <CODE>crontab<\/CODE> \u547d\u4ee4\u66f4\u65b0\u8fd9\u4e9b\u6587\u4ef6\u6216 \/etc\/cron.d \u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u3002 <\/P><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><IMG height=1 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/v14\/rules\/blue_rule.gif\" width=\"100%\"><BR><IMG height=6 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=8 border=0><\/TD><\/TR><\/TBODY><\/TABLE><br \/>\n<TABLE class=no-print cellSpacing=0 cellPadding=0 align=right><br \/>\n<TBODY><br \/>\n<TR align=right><br \/>\n<TD><IMG height=4 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=\"100%\"><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD vAlign=center><BR><\/TD><br \/>\n<TD vAlign=top align=right><A class=fbox href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/l-job-scheduling.html#main\"><B><FONT color=#996699><\/FONT><\/B><\/A><\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR><\/TBODY><\/TABLE><BR><BR><br \/>\n<P><A name=N10196><SPAN class=atitle>\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u8fd0\u884c\u4f5c\u4e1a<\/SPAN><\/A><\/P><br \/>\n<P>\u6709\u65f6\u5019\uff0c\u9700\u8981\u53ea\u8fd0\u884c\u4f5c\u4e1a\u4e00\u6b21\u800c\u4e0d\u662f\u5b9a\u671f\u8fd0\u884c\u3002\u4e3a\u6b64\uff0c\u5e94\u8be5\u4f7f\u7528 <CODE>at<\/CODE> \u547d\u4ee4\u3002\u8981\u8fd0\u884c\u7684\u547d\u4ee4\u662f\u4ece <CODE>-f<\/CODE> \u9009\u9879\u6307\u5b9a\u7684\u6587\u4ef6\u8bfb\u53d6\u7684\uff0c\u5982\u679c\u6ca1\u6709\u4f7f\u7528 <CODE>-f<\/CODE>\uff0c\u90a3\u4e48\u4ece stdin \u8bfb\u53d6\u3002<CODE>-m<\/CODE> \u9009\u9879\u5411\u7528\u6237\u53d1\u9001\u90ae\u4ef6\uff0c\u5373\u4f7f\u547d\u4ee4\u6ca1\u6709 stdout\u3002<CODE>-v<\/CODE> \u9009\u9879\u663e\u793a\u8fd0\u884c\u4f5c\u4e1a\u7684\u65f6\u95f4\u3002\u8fd9\u4e2a\u65f6\u95f4\u4e5f\u663e\u793a\u5728\u8f93\u51fa\u4e2d\u3002<\/P><br \/>\n<P>\u6e05\u5355 5 \u7ed9\u51fa\u4e00\u4e2a\u8fd0\u884c <CODE>mycrontest.sh<\/CODE> \u811a\u672c\u7684\u793a\u4f8b\u3002\u6e05\u5355 6 \u663e\u793a\u5728\u8fd0\u884c\u4f5c\u4e1a\u4e4b\u540e\u901a\u8fc7\u90ae\u4ef6\u53d1\u9001\u7ed9\u7528\u6237\u7684\u8f93\u51fa\u3002\u6ce8\u610f\uff0c\u8fd9\u91cc\u7684\u8f93\u51fa\u6bd4\u5bf9\u5e94\u7684 cron \u4f5c\u4e1a\u8f93\u51fa\u8981\u7b80\u5355\u4e00\u4e9b\u3002 <\/P><BR><A name=N101BD><B>\u6e05\u5355 5. \u4f7f\u7528 at \u547d\u4ee4<\/B><\/A><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"80%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD class=code-outline><PRE class=displaycode><br \/>\n[ian@lyrebird ~]$ at -f mycrontest.sh -v 10:25<br \/>\nSat Jul  7 10:25:00 2007<\/p>\n<p>job 5 at Sat Jul  7 10:25:00 2007<br \/>\n<\/PRE><\/TD><\/TR><\/TBODY><\/TABLE><BR><BR><A name=N101C7><B>\u6e05\u5355 6. \u6765\u81ea at \u7684\u4f5c\u4e1a\u8f93\u51fa<\/B><\/A><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"80%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD class=code-outline><PRE class=displaycode><br \/>\nFrom ian@lyrebird.raleigh.ibm.com  Sat Jul  7 10:25:00 2007<br \/>\nDate: Sat, 7 Jul 2007 10:25:00 -0400<br \/>\nFrom: Ian Shields &lt;ian@lyrebird.raleigh.ibm.com&gt;<br \/>\nSubject: Output from your job        5<br \/>\nTo: ian@lyrebird.raleigh.ibm.com<\/p>\n<p>It is now 10:25:00 on Saturday<\/p>\n<p><\/PRE><\/TD><\/TR><\/TBODY><\/TABLE><BR><br \/>\n<P>\u65f6\u95f4\u7684\u8bbe\u7f6e\u53ef\u4ee5\u975e\u5e38\u590d\u6742\u3002\u6e05\u5355 7 \u7ed9\u51fa\u51e0\u4e2a\u793a\u4f8b\u3002\u53c2\u89c1 <CODE>at<\/CODE> \u7684\u624b\u518c\u9875\u3001\/usr\/share\/doc\/at\/timespec \u6587\u4ef6\u6216 \/usr\/share\/doc\/at-3.1.10\/timespec \u8fd9\u6837\u7684\u6587\u4ef6\uff08\u8fd9\u4e2a\u793a\u4f8b\u4e2d\u7684 3.1.10 \u662f <CODE>at<\/CODE> \u5305\u7684\u7248\u672c\u53f7\uff09\u3002<\/P><BR><A name=N101DC><B>\u6e05\u5355 7. at \u547d\u4ee4\u4f7f\u7528\u7684\u65f6\u95f4\u503c<\/B><\/A><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"80%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD class=code-outline><PRE class=displaycode><br \/>\n[ian@lyrebird ~]$ at -f mycrontest.sh  10pm tomorrow<br \/>\njob 14 at Sun Jul  8 22:00:00 2007<br \/>\n[ian@lyrebird ~]$ at -f mycrontest.sh 2:00 tuesday<br \/>\njob 15 at Tue Jul 10 02:00:00 2007<br \/>\n[ian@lyrebird ~]$ at -f mycrontest.sh 2:00 july 11<br \/>\njob 16 at Wed Jul 11 02:00:00 2007<br \/>\n[ian@lyrebird ~]$ at -f mycrontest.sh 2:00 next week<br \/>\njob 17 at Sat Jul 14 02:00:00 2007<br \/>\n<\/PRE><\/TD><\/TR><\/TBODY><\/TABLE><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"50%\" align=right border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=10><IMG height=1 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=10><\/TD><br \/>\n<TD><br \/>\n<TABLE cellSpacing=0 cellPadding=5 width=\"100%\" border=1><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD bgColor=#eeeeee><A name=N101E5><B>nice \u503c<\/B><\/A><BR><br \/>\n<P><CODE>nice<\/CODE> \u503c\u8868\u793a\u4e00\u4e2a\u4f5c\u4e1a\u5bf9\u4e8e\u5176\u4ed6\u7528\u6237\u7684\u4f18\u5148\u7a0b\u5ea6\u3002\u5173\u4e8e <CODE>nice<\/CODE> \u548c <CODE>renice<\/CODE> \u547d\u4ee4\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u53c2\u89c1\u6559\u7a0b \u201c<A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/views\/linux\/tutorials.jsp?cv_doc_id=100699\"><FONT color=#5c81a7>LPI 101 \u8003\u8bd5\u51c6\u5907\uff1aGNU \u548c UNIX \u547d\u4ee4<\/FONT><\/A>\u201d\u3002 <\/P><\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR><\/TBODY><\/TABLE><br \/>\n<P><CODE>at<\/CODE> \u547d\u4ee4\u8fd8\u6709\u4e00\u4e2a <CODE>-q<\/CODE> \u9009\u9879\u3002\u968f\u7740\u961f\u5217\u7684\u589e\u957f\uff0c\u4f5c\u4e1a\u7684 <CODE>nice<\/CODE> \u503c\u4e5f\u4f1a\u589e\u957f\u3002 \u8fd8\u6709\u4e00\u4e2a <CODE>batch<\/CODE> \u547d\u4ee4\uff0c\u5b83\u4e0e <CODE>at<\/CODE> \u547d\u4ee4\u76f8\u4f3c\uff0c\u4f46\u662f\u4f5c\u4e1a\u53ea\u5728\u7cfb\u7edf\u8d1f\u8f7d\u8db3\u591f\u4f4e\u65f6\u8fd0\u884c\u3002\u8fd9\u4e9b\u7279\u6027\u7684\u7ec6\u8282\u53c2\u89c1\u624b\u518c\u9875\u3002 <\/P><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><IMG height=1 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/v14\/rules\/blue_rule.gif\" width=\"100%\"><BR><IMG height=6 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=8 border=0><\/TD><\/TR><\/TBODY><\/TABLE><br \/>\n<TABLE class=no-print cellSpacing=0 cellPadding=0 align=right><br \/>\n<TBODY><br \/>\n<TR align=right><br \/>\n<TD><IMG height=4 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=\"100%\"><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD vAlign=center><BR><\/TD><br \/>\n<TD vAlign=top align=right><A class=fbox href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/l-job-scheduling.html#main\"><B><FONT color=#996699><\/FONT><\/B><\/A><\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR><\/TBODY><\/TABLE><BR><BR><br \/>\n<P><A name=N10217><SPAN class=atitle>\u7ba1\u7406\u8c03\u5ea6\u7684\u4f5c\u4e1a<\/SPAN><\/A><\/P><br \/>\n<P><A name=N1021C><SPAN class=smalltitle><STRONG><FONT size=3>\u5217\u51fa\u8c03\u5ea6\u7684\u4f5c\u4e1a<\/FONT><\/STRONG><\/SPAN><\/A><\/P><br \/>\n<P>\u53ef\u4ee5\u7ba1\u7406 cron \u548c at \u4f5c\u4e1a\u3002\u4f7f\u7528 <CODE>crontab<\/CODE> \u547d\u4ee4\u548c <CODE>-l<\/CODE> \u9009\u9879\u5217\u51fa crontab\uff0c\u4f7f\u7528 <CODE>atq<\/CODE> \u547d\u4ee4\u663e\u793a\u7528 <CODE>at<\/CODE> \u547d\u4ee4\u52a0\u5165\u961f\u5217\u4e2d\u7684\u4f5c\u4e1a\uff0c\u89c1\u6e05\u5355 8\u3002<\/P><BR><A name=N10238><B>\u6e05\u5355 8. \u663e\u793a\u8c03\u5ea6\u7684\u4f5c\u4e1a<\/B><\/A><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"80%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD class=code-outline><PRE class=displaycode><br \/>\n[ian@lyrebird ~]$ crontab -l<br \/>\n0,20,40 22-23 * 7 fri-sat \/home\/ian\/mycrontest.sh<br \/>\n[ian@lyrebird ~]$ atq<br \/>\n16      Wed Jul 11 02:00:00 2007 a ian<br \/>\n17      Sat Jul 14 02:00:00 2007 a ian<br \/>\n14      Sun Jul  8 22:00:00 2007 a ian<br \/>\n15      Tue Jul 10 02:00:00 2007 a ian<br \/>\n<\/PRE><\/TD><\/TR><\/TBODY><\/TABLE><BR><br \/>\n<P>\u5982\u679c\u5e0c\u671b\u67e5\u770b <CODE>at<\/CODE> \u8c03\u5ea6\u6267\u884c\u7684\u5b9e\u9645\u547d\u4ee4\uff0c\u90a3\u4e48\u53ef\u4ee5\u4f7f\u7528 <CODE>at<\/CODE> \u547d\u4ee4\u5e76\u52a0\u4e0a <CODE>-c<\/CODE> \u9009\u9879\u548c\u4f5c\u4e1a\u53f7\u3002\u60a8\u4f1a\u6ce8\u610f\u5230\uff0c\u5728\u53d1\u51fa <CODE>at<\/CODE> \u547d\u4ee4\u65f6\u751f\u6548\u7684\u5927\u591a\u6570\u73af\u5883\u8bbe\u7f6e\u4f1a\u968f\u8c03\u5ea6\u7684\u4f5c\u4e1a\u4e00\u8d77\u4fdd\u5b58\u3002\u6e05\u5355 9 \u7ed9\u51fa\u6e05\u5355 7 \u548c\u6e05\u5355 8 \u4e2d\u4f5c\u4e1a 15 \u7684\u90e8\u5206\u8f93\u51fa\u3002 <\/P><BR><A name=N10257><B>\u6e05\u5355 9. \u4f7f\u7528 at -c \u5e76\u52a0\u4e0a\u4f5c\u4e1a\u53f7<\/B><\/A><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"80%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD class=code-outline><PRE class=displaycode><br \/>\n#!\/bin\/sh<br \/>\n# atrun uid=500 gid=500<br \/>\n# mail ian 0<br \/>\numask 2<br \/>\nHOSTNAME=lyrebird.raleigh.ibm.com; export HOSTNAME<br \/>\nSHELL=\/bin\/bash; export SHELL<br \/>\nHISTSIZE=1000; export HISTSIZE<br \/>\nSSH_CLIENT=9.67.219.151\\ 3210\\ 22; export SSH_CLIENT<br \/>\nSSH_TTY=\/dev\/pts\/5; export SSH_TTY<br \/>\nUSER=ian; export USER<br \/>\n &#8230;<br \/>\nHOME=\/home\/ian; export HOME<br \/>\nLOGNAME=ian; export LOGNAME<br \/>\n &#8230;<br \/>\ncd \/home\/ian || {<br \/>\n         echo &#8216;Execution directory inaccessible&#8217; &gt;&amp;2<br \/>\n         exit 1<br \/>\n}<br \/>\n${SHELL:-\/bin\/sh} &lt;&lt; `(dd if=\/dev\/urandom count=200 bs=1 \\<br \/>\n   2&gt;\/dev\/null|LC_ALL=C tr -d -c &#8216;[:alnum:]&#8217;)`<\/p>\n<p>#!\/bin\/bash<br \/>\n echo &#8220;It is now $(date +%T) on $(date +%A)&#8221;<br \/>\n<\/PRE><\/TD><\/TR><\/TBODY><\/TABLE><BR><br \/>\n<P>\u6ce8\u610f\uff0c\u6211\u4eec\u811a\u672c\u6587\u4ef6\u7684\u5185\u5bb9\u5df2\u7ecf\u590d\u5236\u5728\u4e00\u4e2a here-document \u4e2d\uff0c\u8fd9\u4e2a here-document \u5c06\u7531 SHELL \u53d8\u91cf\u6307\u5b9a\u7684 shell \u6267\u884c\uff08\u5982\u679c\u6ca1\u6709\u8bbe\u7f6e SHELL \u53d8\u91cf\uff0c\u5c31\u4f7f\u7528 \/bin\/sh\uff09\u3002\u5173\u4e8e here-document \u7684\u4fe1\u606f\u53c2\u89c1\u6559\u7a0b \u201c<A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/views\/linux\/tutorials.jsp?cv_doc_id=100699\"><FONT color=#5c81a7>LPI 101 \u8003\u8bd5\u51c6\u5907\uff0c\u4e3b\u9898 103\uff1aGNU \u548c UNIX \u547d\u4ee4<\/FONT><\/A>\u201d\u3002 <\/P><br \/>\n<P><A name=N10264><SPAN class=smalltitle><STRONG><FONT size=3>\u5220\u9664\u8c03\u5ea6\u7684\u4f5c\u4e1a<\/FONT><\/STRONG><\/SPAN><\/A><\/P><br \/>\n<P>\u53ef\u4ee5\u4f7f\u7528 <CODE>cron<\/CODE> \u547d\u4ee4\u548c <CODE>-r<\/CODE> \u9009\u9879\u5220\u9664\u6240\u6709\u8c03\u5ea6\u7684 cron \u4f5c\u4e1a\uff0c\u89c1\u6e05\u5355 10\u3002<\/P><BR><A name=N10278><B>\u6e05\u5355 10. \u663e\u793a\u5e76\u5220\u9664 cron \u4f5c\u4e1a<\/B><\/A><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"80%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD class=code-outline><PRE class=displaycode><br \/>\n[ian@lyrebird ~]$ crontab -l<br \/>\n0,20,40 22-23 * 7 fri-sat \/home\/ian\/mycrontest.sh<br \/>\n[ian@lyrebird ~]$ crontab -r<br \/>\n[ian@lyrebird ~]$ crontab -l<br \/>\nno crontab for ian<br \/>\n<\/PRE><\/TD><\/TR><\/TBODY><\/TABLE><BR><br \/>\n<P>\u8981\u5220\u9664\u7cfb\u7edf cron \u6216 anacron \u4f5c\u4e1a\uff0c\u5e94\u8be5\u7f16\u8f91 \/etc\/crontab\u3001\/etc\/anacrontab \u6216\u8005\u7f16\u8f91\u6216\u5220\u9664 \/etc\/cron.d \u76ee\u5f55\u4e2d\u7684\u6587\u4ef6\u3002 <\/P><br \/>\n<P>\u53ef\u4ee5\u4f7f\u7528 <CODE>atrm<\/CODE> \u547d\u4ee4\u52a0\u4f5c\u4e1a\u53f7\u5220\u9664\u7528 <CODE>at<\/CODE> \u547d\u4ee4\u8c03\u5ea6\u7684\u4e00\u4e2a\u6216\u591a\u4e2a\u4f5c\u4e1a\u3002\u591a\u4e2a\u4f5c\u4e1a\u5e94\u8be5\u7528\u7a7a\u767d\u5206\u9694\u3002\u6e05\u5355 11 \u7ed9\u51fa\u4e00\u4e2a\u793a\u4f8b\u3002<\/P><BR><A name=N10290><B>\u6e05\u5355 11. \u7528 atq \u548c atrm \u663e\u793a\u5e76\u5220\u9664\u4f5c\u4e1a<\/B><\/A><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"80%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD class=code-outline><PRE class=displaycode><br \/>\n[ian@lyrebird ~]$ atq<br \/>\n16      Wed Jul 11 02:00:00 2007 a ian<br \/>\n17      Sat Jul 14 02:00:00 2007 a ian<br \/>\n14      Sun Jul  8 22:00:00 2007 a ian<br \/>\n15      Tue Jul 10 02:00:00 2007 a ian<br \/>\n[ian@lyrebird ~]$ atrm 16 14 15<br \/>\n[ian@lyrebird ~]$ atq<br \/>\n17      Sat Jul 14 02:00:00 2007 a ian<br \/>\n<\/PRE><\/TD><\/TR><\/TBODY><\/TABLE><BR><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><IMG height=1 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/v14\/rules\/blue_rule.gif\" width=\"100%\"><BR><IMG height=6 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=8 border=0><\/TD><\/TR><\/TBODY><\/TABLE><br \/>\n<TABLE class=no-print cellSpacing=0 cellPadding=0 align=right><br \/>\n<TBODY><br \/>\n<TR align=right><br \/>\n<TD><IMG height=4 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=\"100%\"><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD vAlign=center><BR><\/TD><br \/>\n<TD vAlign=top align=right><A class=fbox href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/l-job-scheduling.html#main\"><B><FONT color=#996699><\/FONT><\/B><\/A><\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR><\/TBODY><\/TABLE><BR><BR><br \/>\n<P><A name=N10296><SPAN class=atitle>\u914d\u7f6e\u7528\u6237\u5bf9\u4f5c\u4e1a\u8c03\u5ea6\u7684\u8bbf\u95ee<\/SPAN><\/A><\/P><br \/>\n<P>\u5982\u679c\u6587\u4ef6 \/etc\/cron.allow \u5b58\u5728\uff0c\u90a3\u4e48\u975e\u6839\u7528\u6237\u5fc5\u987b\u5728\u5176\u4e2d\u5217\u51fa\uff0c\u624d\u80fd\u4f7f\u7528 <CODE>crontab<\/CODE> \u548c cron \u8bbe\u65bd\u3002\u5982\u679c \/etc\/cron.allow \u4e0d\u5b58\u5728\uff0c\u4f46\u662f \/etc\/cron.deny \u5b58\u5728\uff0c\u90a3\u4e48\u5176\u4e2d\u5217\u51fa\u7684\u975e\u6839\u7528\u6237\u4e0d\u80fd\u4f7f\u7528 <CODE>crontab<\/CODE> \u6216 cron \u8bbe\u65bd\u3002\u5982\u679c\u8fd9\u4e24\u4e2a\u6587\u4ef6\u90fd\u4e0d\u5b58\u5728\uff0c\u90a3\u4e48\u53ea\u5141\u8bb8\u8d85\u7ea7\u7528\u6237\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u3002\u7a7a\u7684 \/etc\/cron.deny \u6587\u4ef6\u5141\u8bb8\u6240\u6709\u7528\u6237\u4f7f\u7528 cron \u8bbe\u65bd\uff0c\u8fd9\u662f\u9ed8\u8ba4\u60c5\u51b5\u3002 <\/P><br \/>\n<P>\/etc\/at.allow \u548c \/etc\/at.deny \u6587\u4ef6\u5bf9 at \u8bbe\u65bd\u8d77\u76f8\u4f3c\u7684\u4f5c\u7528\u3002<\/P><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD><IMG height=1 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/v14\/rules\/blue_rule.gif\" width=\"100%\"><BR><IMG height=6 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=8 border=0><\/TD><\/TR><\/TBODY><\/TABLE><br \/>\n<TABLE class=no-print cellSpacing=0 cellPadding=0 align=right><br \/>\n<TBODY><br \/>\n<TR align=right><br \/>\n<TD><IMG height=4 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=\"100%\"><BR><br \/>\n<TABLE cellSpacing=0 cellPadding=0 border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD vAlign=center><BR><\/TD><br \/>\n<TD vAlign=top align=right><A class=fbox href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/l-job-scheduling.html#main\"><B><FONT color=#996699><\/FONT><\/B><\/A><\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR><\/TBODY><\/TABLE><BR><BR><br \/>\n<P><A name=N102A9><SPAN class=atitle>\u4e86\u89e3\u66f4\u591a\u4fe1\u606f<\/SPAN><\/A><\/P><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=150 align=right border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD width=10><\/TD><br \/>\n<TD><\/TD><\/TR><\/TBODY><\/TABLE><br \/>\n<P>\u5982\u679c\u60f3\u4e86\u89e3\u5173\u4e8e Linux \u7ba1\u7406\u4efb\u52a1\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u9605\u8bfb\u6559\u7a0b \u201c<A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/edu\/l-dw-l-lpi1111.html\"><FONT color=#5c81a7>LPI 102 \u8003\u8bd5\u51c6\u5907\uff1a\u7ba1\u7406\u4efb\u52a1<\/FONT><\/A>\u201d\uff0c\u6216\u8005\u53c2\u89c1\u4e0b\u9762\u7684 <A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/l-job-scheduling.html#resources\"><FONT color=#996699>\u53c2\u8003\u8d44\u6599<\/FONT><\/A>\u3002\u4e0d\u8981\u5fd8\u8bb0 <A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/l-job-scheduling.html#rate\"><FONT color=#996699>rate \u8fd9\u4e2a\u9875\u9762<\/FONT><\/A>\u3002<BR><\/P><br \/>\n<P><A name=resources><SPAN class=atitle>\u53c2\u8003\u8d44\u6599 <\/SPAN><\/A><\/P><B>\u5b66\u4e60<\/B><BR><br \/>\n<UL><br \/>\n<LI>\u60a8\u53ef\u4ee5\u53c2\u9605\u672c\u6587\u5728 developerWorks \u5168\u7403\u7ad9\u70b9\u4e0a\u7684 <A href=\"http:\/\/www.ibm.com\/developerworks\/linux\/library\/l-job-scheduling.html?S_TACT=105AGX52&amp;S_CMP=cn-a-l\" target=_blank><FONT color=#5c81a7>\u82f1\u6587\u539f\u6587<\/FONT><\/A>\u3002<BR><BR><br \/>\n<LI>\u56de\u987e\u6559\u7a0b \u201c<A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/edu\/l-dw-l-lpi1111.html\"><FONT color=#5c81a7>LPI 102 \u8003\u8bd5\u51c6\u5907\uff1a\u7ba1\u7406\u4efb\u52a1<\/FONT><\/A>\u201d\uff08developerWorks\uff0c2007 \u5e74 7 \u6708\uff09\uff0c\u4e86\u89e3\u5173\u4e8e Linux \u4e0a\u5176\u4ed6\u7ba1\u7406\u4efb\u52a1\u7684\u4fe1\u606f\uff0c\u5305\u62ec\u7528\u6237\u7ba1\u7406\u3001\u5907\u4efd\u3001\u7cfb\u7edf\u65e5\u5fd7\u548c Network Time Protocol\u3002\u5b83\u662f <A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/lpi\/index.html\"><FONT color=#5c81a7>LPI \u8003\u8bd5\u51c6\u5907\u6559\u7a0b\u7cfb\u5217<\/FONT><\/A> \u7684\u4e00\u90e8\u5206\uff0c\u8fd9\u4e2a\u7cfb\u5217\u8986\u76d6 Linux \u57fa\u7840\u77e5\u8bc6\uff0c\u5e2e\u52a9\u60a8\u51c6\u5907\u7cfb\u7edf\u7ba1\u7406\u5458\u8ba4\u8bc1\u3002\u672c\u6559\u7a0b\u8fd8\u5f15\u7528\u4e86\u8fd9\u4e2a\u7cfb\u5217\u4e2d\u7684\u4e24\u4e2a\u6559\u7a0b \u201c<A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/views\/linux\/tutorials.jsp?cv_doc_id=100699\"><FONT color=#5c81a7>LPI 101 \u8003\u8bd5\u51c6\u5907\uff1aGNU \u548c UNIX \u547d\u4ee4<\/FONT><\/A>\u201d \u548c \u201c<A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/views\/linux\/tutorials.jsp?cv_doc_id=102617\"><FONT color=#5c81a7>LPI 101 \u8003\u8bd5\u51c6\u5907\uff1a\u8bbe\u5907\u3001Linux \u6587\u4ef6\u7cfb\u7edf\u548c Filesystem Hierarchy Standard<\/FONT><\/A>\u201d\u3002 <BR><BR><br \/>\n<LI><A href=\"http:\/\/www.tldp.org\/\"><FONT color=#5c81a7>Linux Documentation Project<\/FONT><\/A> \u6709\u5f88\u591a\u975e\u5e38\u6709\u7528\u7684\u6587\u6863\uff0c\u5c24\u5176\u662f\u5176\u4e2d\u7684 HOWTO \u6307\u5bfc\u3002<BR><BR><br \/>\n<LI>\u5728 <A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/\"><FONT color=#996699>developerWorks Linux \u4e13\u533a<\/FONT><\/A> \u4e2d\u53ef\u4ee5\u627e\u5230\u4e3a Linux \u5f00\u53d1\u4eba\u5458\u51c6\u5907\u7684\u66f4\u591a\u6559\u7a0b\uff0c\u5305\u62ec <A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/views\/linux\/tutorials.jsp\"><FONT color=#5c81a7>Linux \u6559\u7a0b<\/FONT><\/A>\uff0c\u4ee5\u53ca\u6700\u8fd1\u51e0\u4e2a\u6708 <A href=\"http:\/\/www.ibm.com\/developerworks\/cn\/linux\/top10\/\"><FONT color=#5c81a7>\u8bfb\u8005\u6700\u559c\u7231\u7684 Linux \u6587\u7ae0\u548c\u6559\u7a0b<\/FONT><\/A>\u3002 <BR><BR><br \/>\n<LI>\u968f\u65f6\u5173\u6ce8 <A href=\"http:\/\/www.ibm.com\/developerworks\/offers\/techbriefings\/?S_TACT=105AGX52&amp;S_CMP=cn-a-l\"><FONT color=#5c81a7>developerWorks \u6280\u672f\u6d3b\u52a8\u548c\u7f51\u7edc\u5e7f\u64ad<\/FONT><\/A>\u3002 <\/LI><\/UL><BR><B>\u83b7\u5f97\u4ea7\u54c1\u548c\u6280\u672f<\/B><BR><br \/>\n<UL><br \/>\n<LI><A href=\"http:\/\/www.ibm.com\/developerworks\/offers\/sek\/?S_TACT=105AGX52&amp;S_CMP=cn-a-l\"><FONT color=#5c81a7>\u7d22\u53d6 SEK for Linux<\/FONT><\/A>\uff0c\u8fd9\u5957 DVD\uff08\u4e24\u5f20\uff09\u5305\u542b\u6765\u81ea DB2\u00ae\u3001Lotus\u00ae\u3001Rational\u00ae\u3001Tivoli\u00ae \u548c WebSphere\u00ae \u7684\u6700\u65b0 IBM \u8bd5\u7528\u7248 Linux \u8f6f\u4ef6\u3002 <BR><BR><br \/>\n<LI>\u4f7f\u7528 <A href=\"http:\/\/www.ibm.com\/developerworks\/downloads\/?S_TACT=105AGX52&amp;S_CMP=cn-a-l\"><FONT color=#5c81a7>IBM \u8bd5\u7528\u8f6f\u4ef6<\/FONT><\/A> \u6784\u5efa\u60a8\u7684\u4e0b\u4e00\u4e2a Linux \u5f00\u53d1\u9879\u76ee\uff0c\u8fd9\u4e9b\u8f6f\u4ef6\u53ef\u4ee5\u4ece developerWorks \u76f4\u63a5\u4e0b\u8f7d\u3002<BR><BR><\/LI><\/UL><BR><B>\u8ba8\u8bba<\/B><BR><br \/>\n<UL><br \/>\n<LI><A href=\"http:\/\/www.ibm.com\/developerworks\/forums\/dw_forum.jsp?forum=160&amp;cat=5\"><FONT color=#5c81a7>\u53c2\u4e0e\u8bba\u575b\u8ba8\u8bba<\/FONT><\/A>\u3002<BR><BR><br \/>\n<LI>\u901a\u8fc7\u65b0\u7684 <A href=\"http:\/\/www.ibm.com\/developerworks\/spaces\/?S_TACT=105AGX52&amp;S_CMP=cn-a-l\"><FONT color=#5c81a7>developerWorks spaces<\/FONT><\/A> \u4e2d\u7684\u5f00\u53d1\u4eba\u5458 blog\u3001\u8bba\u575b\u3001podcast \u548c\u793e\u533a\u4e3b\u9898\uff0c\u52a0\u5165 <A href=\"http:\/\/www.ibm.com\/developerworks\/community?S_TACT=105AGX52&amp;S_CMP=cn-a-l\"><FONT color=#5c81a7>developerWorks \u793e\u533a<\/FONT><\/A>\u3002<BR><BR><\/LI><\/UL><BR><BR><br \/>\n<P><A name=author><SPAN class=atitle>\u5173\u4e8e\u4f5c\u8005<\/SPAN><\/A><\/P><br \/>\n<TABLE cellSpacing=0 cellPadding=0 width=\"100%\" border=0><br \/>\n<TBODY><br \/>\n<TR><br \/>\n<TD colSpan=3><IMG height=5 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=\"100%\"><\/TD><\/TR><br \/>\n<TR vAlign=top align=left><br \/>\n<TD><br \/>\n<P><IMG height=80 alt=\"Ian Shields\" src=\"http:\/\/www-106.ibm.com\/developerworks\/i\/p-ishields.jpg\" width=64 align=left><\/P><\/TD><br \/>\n<TD><IMG height=5 alt=\"\" src=\"http:\/\/www.ibm.com\/i\/c.gif\" width=4><\/TD><br \/>\n<TD width=\"100%\"><br \/>\n<P>Ian Shields \u4e3a developerWorks Linux \u4e13\u533a\u7684\u8bb8\u591a Linux \u9879\u76ee\u5de5\u4f5c\u3002\u4ed6\u662f IBM \u5317\u5361\u7f57\u83b1\u90a3\u5dde Research Triangle Park \u7684\u4e00\u540d\u9ad8\u7ea7\u7a0b\u5e8f\u5458\u3002\u4ed6\u4e8e 1973 \u5e74\u4f5c\u4e3a\u4e00\u540d\u7cfb\u7edf\u5de5\u7a0b\u5e08\u52a0\u5165 IBM \u4f4d\u4e8e\u6fb3\u5927\u5229\u4e9a\u582a\u57f9\u62c9\u7684\u5b50\u516c\u53f8\u3002\u4e4b\u540e\uff0c\u5728\u52a0\u62ff\u5927\u8499\u7279\u5229\u5c14\u548c\u5317\u5361\u7f57\u83b1\u90a3\u5dde RTP \u4ece\u4e8b\u901a\u4fe1\u7cfb\u7edf\u548c\u666e\u53ca\u8fd0\u7b97\u3002\u4ed6\u62e5\u6709\u591a\u9879\u4e13\u5229\u5e76\u53d1\u8868\u4e86\u82e5\u5e72\u7bc7\u8bba\u6587\u3002\u4ed6\u6bd5\u4e1a\u4e8e Australian National University\uff0c\u672c\u79d1\u5b66\u4f4d\u662f\u7eaf\u6570\u5b66\u548c\u54f2\u5b66\u3002\u4ed6\u62e5\u6709\u5317\u5361\u7f57\u6765\u7eb3\u5dde\u7acb\u5927\u5b66\u7684\u8ba1\u7b97\u673a\u7855\u58eb\u548c\u535a\u58eb\u5b66\u4f4d\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7 <A href=\"mailto:ishields@us.ibm.com?subject=Installing IBM Rational Application Developer V6.0 Trial for Linux\"><FONT color=#5c81a7>ishields@us.ibm.com<\/FONT><\/A> \u4e0e Ian \u8054\u7cfb\u3002<\/P><\/TD><\/TR><\/TBODY><\/TABLE><\/DIV><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux \u6280\u5de7: \u7528 cron \u548c at \u8c03\u5ea6\u4f5c\u4e1a \u5982\u4f55\u8f7b\u677e\u5730\u7ba1\u7406\u7cfb\u7edf 2007 \u5e74 8 \u6708 27 \u65e5 \u7cfb\u7edf\u7ba1\u7406\u5458\u9700\u8981\u5728\u7cfb\u7edf\u8d1f\u8f7d\u4f4e\u7684\u5348\u591c\u8fd0\u884c\u4f5c\u4e1a\uff0c\u6216\u8005\u9700\u8981\u6bcf\u5929\u6216\u6bcf\u6708\u8fd0\u884c\u4f5c\u4e1a\uff0c\u540c\u65f6\u53c8\u4e0d\u613f\u610f\u727a\u7272\u7761\u7720\u65f6\u95f4\u6216\u5047\u671f\u3002\u8c03\u5ea6\u4efb\u52a1\u7684\u5176\u4ed6\u539f\u56e0\u5305\u62ec\u81ea\u52a8\u6267\u884c\u65e5\u5e38\u4efb\u52a1\u6216\u8005\u786e\u4fdd\u6bcf\u6b21\u90fd\u4ee5\u76f8\u540c\u7684\u65b9\u5f0f\u5904\u7406\u4efb\u52a1\u3002\u672c\u6587\u5e2e\u52a9\u60a8\u4f7f\u7528 cron \u548c at \u529f\u80fd\u8c03\u5ea6\u4f5c\u4e1a\u5b9a\u671f\u8fd0\u884c\u6216\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u8fd0\u884c\u4e00\u6b21\u3002 Linux\u00ae \u548c UNIX\u00ae \u7cfb\u7edf\u5141\u8bb8\u8c03\u5ea6\u4efb\u52a1\u5728\u4ee5\u540e\u6267\u884c\u4e00\u6b21\uff0c\u6216\u8005\u91cd\u590d\u8fd0\u884c\u3002\u672c\u6587\u662f\u4ece developerWorks \u6559\u7a0b \u201cLPI 102 \u8003\u8bd5\u51c6\u5907\uff1a\u7ba1\u7406\u4efb\u52a1\u201d \u6458\u5f55\u7684\uff0c\u8bb2\u89e3\u5982\u4f55\u8c03\u5ea6\u4f5c\u4e1a\u5b9a\u671f\u8fd0\u884c\uff0c\u6216\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u8fd0\u884c\u4e00\u6b21\u3002 \u5728 Linux \u7cfb\u7edf\u4e0a\uff0c\u8bb8\u591a\u7ba1\u7406\u4efb\u52a1\u5fc5\u987b\u9891\u7e41\u5730\u5b9a\u671f\u6267\u884c\u3002\u8fd9\u4e9b\u4efb\u52a1\u5305\u62ec\u8f6e\u8f6c\u65e5\u5fd7\u6587\u4ef6\u4ee5\u907f\u514d\u88c5\u6ee1\u6587\u4ef6\u7cfb\u7edf\u3001\u5907\u4efd\u6570\u636e\u548c\u8fde\u63a5\u65f6\u95f4\u670d\u52a1\u5668\u6765\u6267\u884c\u7cfb\u7edf\u65f6\u95f4\u540c\u6b65\u3002\u4e0a\u9762\u63d0\u5230\u7684\u6559\u7a0b\u66f4\u8be6\u7ec6\u5730\u4ecb\u7ecd\u4e86\u8fd9\u4e9b\u7ba1\u7406\u4efb\u52a1\u3002\u5728\u672c\u6587\u4e2d\uff0c\u5b66\u4e60 Linux \u4e2d\u63d0\u4f9b\u7684\u8c03\u5ea6\u673a\u5236\uff0c\u5305\u62ec cron \u548c anacron \u8bbe\u65bd\u4ee5\u53ca crontab \u548c at \u547d\u4ee4\u3002\u5373\u4f7f\u7cfb\u7edf\u5e38\u5e38\u5173\u673a\uff0canacron \u4e5f\u53ef\u4ee5\u5e2e\u52a9\u8c03\u5ea6\u4f5c\u4e1a\u3002 \u4ee5\u4e00\u5b9a\u7684\u65f6\u95f4\u95f4\u9694\u8fd0\u884c\u4f5c\u4e1a \u4ee5\u4e00\u5b9a\u7684\u65f6\u95f4\u95f4\u9694\u8fd0\u884c\u4f5c\u4e1a\u9700\u8981\u4f7f\u7528 cron \u8bbe\u65bd\u8fdb\u884c\u7ba1\u7406\uff0c\u5b83\u7531 crond \u5b88\u62a4\u8fdb\u7a0b\u548c\u4e00\u7ec4\u8868\uff08\u63cf\u8ff0\u6267\u884c\u54ea\u4e9b\u64cd\u4f5c\u548c\u91c7\u7528\u4ec0\u4e48\u6837\u7684\u9891\u7387\uff09\u7ec4\u6210\u3002\u8fd9\u4e2a\u5b88\u62a4\u8fdb\u7a0b\u6bcf\u5206\u949f\u5524\u9192\u4e00\u6b21\uff0c\u5e76\u901a\u8fc7\u68c0\u67e5 crontab \u5224\u65ad\u9700\u8981\u505a\u4ec0\u4e48\u3002\u7528\u6237\u4f7f\u7528 crontab \u547d\u4ee4\u7ba1\u7406 crontab\u3002crond \u5b88\u62a4\u8fdb\u7a0b\u5e38\u5e38\u662f\u5728\u7cfb\u7edf\u542f\u52a8\u65f6\u7531 &hellip; <a href=\"https:\/\/www.strongd.net\/?p=259\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Linux \u6280\u5de7: \u7528 cron \u548c at \u8c03\u5ea6\u4f5c\u4e1a<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-259","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=259"}],"version-history":[{"count":0,"href":"https:\/\/www.strongd.net\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.strongd.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}