\u8fd9\u7bc7\u6587\u7ae0<\/a><\/p><\/blockquote>\n<\/p>\n
\u5728exit 0\u4e0a\u9762\u7f16\u8f91\u542f\u52a8\u811a\u672c\u7684\u547d\u4ee4<\/p>\n
\/usr\/bin\/python3 \/home\/selfcs\/auto.py > \/home\/selfcs\/auto.log<\/code><\/pre>\n\u6700\u540e\u91cd\u542fLinux,\u811a\u672c\u5c31\u80fd\u81ea\u52a8\u8fd0\u884c\u5e76\u6253\u5370\u65e5\u5fd7\u4e86\u3002<\/p>\n
\u4e8c\u3001\u8ba9Python\u811a\u672c\u5b9a\u65f6\u542f\u52a8<\/strong><\/div>\n\u7528root\u6743\u9650\u7f16\u8f91\u4ee5\u4e0b\u6587\u4ef6<\/p>\n
sudo vim \/etc\/crontab<\/code><\/pre>\n<\/p>\n
\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u4ee5\u4e0b\u547d\u4ee4<\/p>\n
2 * * * * root \/usr\/bin\/python3 \/home\/selfcs\/auto.py > \/home\/selfcs\/auto.log<\/code><\/pre>\n\u4ee5\u4e0a\u4ee3\u7801\u7684\u610f\u601d\u662f\u6bcf\u9694\u4e24\u5206\u949f\u6267\u884c\u4e00\u6b21\u811a\u672c\u5e76\u6253\u5370\u65e5\u5fd7\u3002<\/p>\n
\u4e09\u3001crontab\u7f16\u5199\u89e3\u91ca<\/strong><\/div>\n\u57fa\u672c\u683c\u5f0f<\/p>\n
* * * * * user command\r\n\u5206 \u65f6 \u65e5 \u6708 \u5468 \u7528\u6237 \u547d\u4ee4<\/code><\/pre>\n3.1 \u4e3e\u4f8b\u8bf4\u660e<\/strong><\/span><\/div>\n1\u3001\u6bcf\u5206\u949f\u6267\u884c\u4e00\u6b21<\/p>\n
* * * * * user command<\/code><\/pre>\n2\u3001\u6bcf\u96942\u5c0f\u65f6\u6267\u884c\u4e00\u6b21<\/p>\n
* *\/2 * * * user command (\/\u8868\u793a\u9891\u7387)<\/code><\/pre>\n3\u3001\u6bcf\u59298:30\u5206\u6267\u884c\u4e00\u6b21<\/p>\n
30 8 * * * user command<\/code><\/pre>\n4\u3001\u6bcf\u5c0f\u65f6\u768430\u548c50\u5206\u5404\u6267\u884c\u4e00\u6b21<\/p>\n
30,50 * * * * user command\uff08,\u8868\u793a\u5e76\u5217\uff09<\/code><\/pre>\n5\u3001\u6bcf\u4e2a\u6708\u76843\u53f7\u52306\u53f7\u76848:30\u6267\u884c\u4e00\u6b21<\/p>\n
30 8 3-6 * * user command \uff08-\u8868\u793a\u8303\u56f4\uff09<\/code><\/pre>\n6\u3001\u6bcf\u4e2a\u661f\u671f\u4e00\u76848:30\u6267\u884c\u4e00\u6b21<\/p>\n
30 8 * * 1 user command \uff08\u5468\u7684\u8303\u56f4\u4e3a0-7,0\u548c7\u4ee3\u8868\u5468\u65e5\uff09<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"\u5047\u5982Python\u81ea\u542f\u52a8\u811a\u672c\u4e3aauto.py\u3002\u90a3\u4e48\u7528root\u6743\u9650\u7f16\u8f91\u4ee5\u4e0b\u6587\u4ef6\uff1a sudo vim \/etc\/rc […]<\/p>\n","protected":false},"author":63,"featured_media":158655,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-158652","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\/158652","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=158652"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/158652\/revisions"}],"predecessor-version":[{"id":159083,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/158652\/revisions\/159083"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/158655"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=158652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=158652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=158652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}