{"id":176473,"date":"2020-04-22T10:18:14","date_gmt":"2020-04-22T02:18:14","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=176473"},"modified":"2020-04-10T09:15:59","modified_gmt":"2020-04-10T01:15:59","slug":"crontab-linux-usage","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/crontab-linux-usage.html","title":{"rendered":"\u5206\u4eabcrontab\u547d\u4ee4\u5728Linux\u4e2d\u7684\u57fa\u672c\u4f7f\u7528\u65b9\u6cd5"},"content":{"rendered":"
\u5bfc\u8bfb<\/td>\n | Linux\u4e2dcrontab\u547d\u4ee4\u7684\u57fa\u672c\u4f7f\u7528\u793a\u4f8b\uff1a<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n <\/p>\n crontab\u6587\u4ef6\u7531\u516d\u4e2a\u57df\u7ec4\u6210\uff0c\u6bcf\u4e2a\u57df\u4e4b\u95f4\u7528\u7a7a\u683c\u5206\u5272\uff0c\u5176\u6392\u5217\u5982\u4e0b\uff1aB \u3002<\/p>\n A MIN HOUR DAY MONTH YEAR COMMAND<\/p>\n B MIN HOUR DAY MONTH DAYOFWEEK COMMAND<\/p>\n C COMMAND HOUR DAY MONTH DAYOFWEEK<\/p>\n D COMMAND YEAR MONTH DAY HOUR MIN<\/p>\n crontab\u7684\u57fa\u672c\u683c\u5f0f\uff1a<\/p>\n f1\u3000 f2\u3000\u3000f3\u3000 f4\u3000\u3000f5\u3000\u3000command<\/p>\n \u5206\u3000 \u65f6 \u65e5 \u3000\u6708\u3000\u3000\u5468\u3000\u3000\u547d\u4ee4<\/p>\n \u7b2c\u4e00\u5217f1\u4ee3\u8868\u5206\u949f1~59\uff1a\u5f53f1\u4e3a*\u8868\u793a\u6bcf\u5206\u949f\u90fd\u8981\u6267\u884c\uff1b\u4e3a*\/n\u8868\u793a\u6bcfn\u5206\u949f\u6267\u884c\u4e00\u6b21\uff1b\u4e3aa-b\u8868\u793a\u4ece\u7b2ca\u5206\u949f\u5230\u7b2cb\u5206\u949f\u8fd9\u6bb5\u65f6\u95f4\u8981\u6267\u884c\uff1b\u4e3aa,b,c,...\u8868\u793a\u7b2ca,b,c\u5206\u949f\u8981\u6267\u884c<\/p>\n \u7b2c\u4e8c\u5217f2\u4ee3\u8868\u5c0f\u65f60~23\uff080\u8868\u793a\u51cc\u6668\uff09\uff1a\u5f53f2\u4e3a*\u8868\u793a\u6bcf\u5c0f\u65f6\u90fd\u8981\u6267\u884c\uff1b\u4e3a*\/n\u8868\u793a\u6bcfn\u5c0f\u6570\u6267\u884c\u4e00\u6b21\uff1b\u4e3aa-b\u8868\u793a\u4ece\u7b2ca\u5c0f\u65f6\u5230\u7b2cb\u5c0f\u65f6\u8fd9\u6bb5\u65f6\u95f4\u8981\u6267\u884c\uff1b\u4e3aa,b,c,...\u8868\u793a\u7b2ca,b,c\u5c0f\u65f6\u8981\u6267\u884c<\/p>\n \u7b2c\u4e09\u5217f3\u4ee3\u8868\u65e51~31\uff1a\u542b\u4e49\u5982\u4e0a\u6240\u793a\uff0c\u4ee5\u6b64\u7c7b\u63a8<\/p>\n \u7b2c\u56db\u5217f4\u4ee3\u8868\u67081~12\uff1a\u542b\u4e49\u5982\u4e0a\u6240\u793a\uff0c\u4ee5\u6b64\u7c7b\u63a8<\/p>\n \u7b2c\u4e94\u5217f5\u4ee3\u8868\u661f\u671f0~6\uff080\u8868\u793a\u661f\u671f\u5929\uff09\uff1a\u542b\u4e49\u5982\u4e0a\u6240\u793a\uff0c\u4ee5\u6b64\u7c7b\u63a8<\/p>\n \u7b2c\u516d\u5217command\u4ee3\u8868\u8981\u8fd0\u884c\u7684\u547d\u4ee4<\/p>\n \u6b64\u5904\u6362\u6210\u81ea\u5df1\u7684\u5185\u5bb9<\/strong><\/div>\n \u4e0b\u9762\u6765\u4e3e\u4f8b\u5177\u4f53\u8bf4\u660e\u4e00\u4e0bcrontab\u683c\u5f0f\u7684\u542b\u4e49\uff1a<\/p>\n 30 20 * * * \/usr\/local\/apache\/bin\/apachectl restart<\/pre>\n |