{"id":1456,"date":"2023-03-23T22:28:47","date_gmt":"2023-03-23T14:28:47","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1456"},"modified":"2023-04-28T20:42:53","modified_gmt":"2023-04-28T12:42:53","slug":"timed-task-settings-under-centos","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/23\/timed-task-settings-under-centos\/","title":{"rendered":"CentOS\u4e0b\u5b9a\u65f6\u4efb\u52a1\u8bbe\u7f6e"},"content":{"rendered":"<h2>\u914d\u7f6ecrontab<\/h2>\n<p><code>crontab -e<\/code>\u7136\u540e\uff0c\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801\u884c\uff1a<\/p>\n<p><!-- more --><\/p>\n<pre><code class=\"language-bash\"># \u8868\u793a\u6bcf\u4e2a\u5c0f\u65f6\u7684\u7b2c\u4e94\u5206\u949f\u6267\u884c\u4e00\u6b21\u811a\u672c\n5 * * * * \/data\/cron\/hourly_archive.sh\n\n# \u8868\u793a\u6bcf\u5929\u76841:00\u6267\u884c\u4e00\u6b21\u811a\u672c\n0 1 * * * \/data\/cron\/daily_archive.sh\n\n# \u8868\u793a\u6bcf\u4e2a\u661f\u671f\u59290:30\u6267\u884c\u4e00\u6b21\u811a\u672c\n30 0 * * 0 \/data\/cron\/weekly_archive.sh\n\n# \u8868\u793a\u6bcf\u4e2a\u6708\u7b2c\u4e00\u59290:30\u6267\u884c\u4e00\u6b21\u811a\u672c\n30 0 1 * * \/data\/cron\/monthly_archive.sh\n\n# \u8868\u793a\u6bcf\u59291:30\u6267\u884c\u4e00\u6b21\u811a\u672c\n30 1 * * * \/data\/cron\/laterdata_archive.sh<\/code><\/pre>\n<h2>\u91cd\u542f\u5b9a\u65f6\u4efb\u52a1<\/h2>\n<pre><code class=\"language-bash\">systemctl restart crond<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u914d\u7f6ecrontab crontab -e\u7136\u540e\uff0c\u589e\u52a0\u4ee5\u4e0b\u4ee3\u7801\u884c\uff1a # \u8868\u793a\u6bcf\u4e2a\u5c0f\u65f6\u7684\u7b2c\u4e94\u5206\u949f\u6267\u884c\u4e00\u6b21\u811a\u672c 5 * [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[331],"tags":[168],"class_list":["post-1456","post","type-post","status-publish","format-standard","hentry","category-linux","tag-cron"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1456"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1456\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}