{"id":1082,"date":"2017-11-18T12:00:00","date_gmt":"2017-11-18T03:00:00","guid":{"rendered":"https:\/\/hi3103.net\/notes\/?p=1082"},"modified":"2022-07-09T23:33:59","modified_gmt":"2022-07-09T14:33:59","slug":"%e8%a8%bc%e6%98%8e%e6%9b%b8%e3%81%ae%e6%9b%b4%e6%96%b0%e3%82%92cron%e3%81%a7%e8%87%aa%e5%8b%95%e5%8c%96%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/hi3103.net\/notes\/web\/1082","title":{"rendered":"\u5c0e\u5165\u3057\u305fSSL\u8a3c\u660e\u66f8( Let\u2019s Encrypt )\u306e\u66f4\u65b0\u3092cron\u3067\u81ea\u52d5\u5316\u3059\u308b"},"content":{"rendered":"<h4>\u53c2\u8003URL<\/h4>\n<ul>\n<li><a href=\"https:\/\/eng-entrance.com\/linux-cron-at\">\u3010Linux\u306e\u30b8\u30e7\u30d6\u30b9\u30b1\u30b8\u30e5\u30fc\u30ea\u30f3\u30b0\u3011cron\u3068at \u3068\u30a2\u30af\u30bb\u30b9\u5236\u5fa1<\/a><\/li>\n<li><a href=\"https:\/\/qiita.com\/takahashi-kazuki\/items\/77d669d4414c6ec185f9\">\u3010\u9055\u3044\u3011\/etc\/crontab\u3068\/var\/spool\/cron\/user &#8211; Qiita<\/a><\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h4>cron\u306e\u7a3c\u50cd\u72b6\u6cc1\u3092\u78ba\u8a8d\u3059\u308b<\/h4>\n<h5>cronie\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d<\/h5>\n<pre><code class=\"language-sh\"># yum list cronie\n\uff08\u7565\uff09\nInstalled Packages\ncronie.x86_64                                     1.4.11-17.el7                                      @base<\/code><\/pre>\n<ul>\n<li>\u3042\u308b\uff08centOS7\u3067\u30c7\u30d5\u30a9\u30eb\u30c8\u3089\u3057\u3044\uff09<\/li>\n<\/ul>\n<h5>cron\u304c\u7a3c\u50cd\u3057\u3066\u3044\u308b\u304b\u78ba\u8a8d<\/h5>\n<pre><code class=\"language-sh\"># systemctl status crond\n#  crond.service - Command Scheduler\n   Loaded: loaded (\/usr\/lib\/systemd\/system\/crond.service; enabled; vendor preset: enabled)\n   Active: active (running) since Thu 2017-11-09 14:29:50 JST; 1 weeks 2 days ago\n\uff08\u7565\uff09<\/code><\/pre>\n<ul>\n<li>active (running) \u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067OK<\/li>\n<\/ul>\n<h5>\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5\u6642\u306b\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d<\/h5>\n<pre><code class=\"language-sh\"># systemctl list-unit-files | grep cron\ncrond.service                                 enabled<\/code><\/pre>\n<ul>\n<li>enabled \u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067OK<\/li>\n<\/ul>\n<h4>cron\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u8a3c\u660e\u66f8\u66f4\u65b0\u30b3\u30de\u30f3\u30c9\u3092\u8ffd\u8a18\u3059\u308b<\/h4>\n<h5>cron\u3067\u5b9f\u884c\u3057\u305f\u3044\u30b3\u30de\u30f3\u30c9\u306e\u30d5\u30eb\u30d1\u30b9\u3092\u8abf\u3079\u308b<\/h5>\n<pre><code class=\"language-sh\"># which certbot\n\/usr\/bin\/certbot<\/code><\/pre>\n<ul>\n<li>\u8a3c\u660e\u66f8\u66f4\u65b0\u306e\u30b3\u30de\u30f3\u30c9\u3092\u30d5\u30eb\u30d1\u30b9\u304b\u3089\u66f8\u304f\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b<\/li>\n<\/ul>\n<pre><code>\/usr\/bin\/certbot renew<\/code><\/pre>\n<ul>\n<li>\u6709\u52b9\u671f\u9650\u306e\u6b8b\u308a\u304c30\u65e5\u672a\u6e80\u306e\u5834\u5408\u306b\u306e\u307f\u66f4\u65b0\u3055\u308c\u308b<\/li>\n<li>\u5373\u6642\u66f4\u65b0\u306e\u5834\u5408\u306f &#8211;force-renew \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u52a0\u3048\u308b<\/li>\n<\/ul>\n<h5>cron\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u7de8\u96c6\u3059\u308b<\/h5>\n<pre><code class=\"language-sh\"># vi \/etc\/crontab<\/code><\/pre>\n<pre><code>      1 SHELL=\/bin\/bash\n      2 PATH=\/sbin:\/bin:\/usr\/sbin:\/usr\/bin\n      3 MAILTO=root\n      4 \n      5 # For details see man 4 crontabs\n      6 \n      7 # Example of job definition:\n      8 # .---------------- minute (0 - 59)\n      9 # |  .------------- hour (0 - 23)\n     10 # |  |  .---------- day of month (1 - 31)\n     11 # |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...\n     12 # |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat\n     13 # |  |  |  |  |\n     14 # *  *  *  *  * user-name  command to be executed<\/code><\/pre>\n<ul>\n<li>\u66f8\u5f0f\u306b\u5247\u3063\u3066\u8a3c\u660e\u66f8\u66f4\u65b0\u30b3\u30de\u30f3\u30c9\u3092\u8a18\u8ff0\n<ul>\n<li>\u6bce\u65e53:00\u306broot\u6a29\u9650\u3067\u5b9f\u884c\u3059\u308b\u5834\u5408<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<table>\n<thead>\n<tr>\n<th>\u5206<\/th>\n<th>\u6642<\/th>\n<th>\u65e5<\/th>\n<th>\u6708<\/th>\n<th>\u66dc\u65e5<\/th>\n<th>\u30e6\u30fc\u30b6\u540d<\/th>\n<th>\u5b9f\u884c\u30b3\u30de\u30f3\u30c9<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>0<\/td>\n<td>3<\/td>\n<td>*<\/td>\n<td>*<\/td>\n<td>*<\/td>\n<td>root<\/td>\n<td>\/usr\/bin\/certbot renew<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre><code>0  3  *  *  * root \/usr\/bin\/certbot renew<\/code><\/pre>\n<ul>\n<li>2017-11-18\u73fe\u5728\u3001\u6709\u52b9\u671f\u9650\u304c\u300c2018\u5e742\u670816\u65e5\u300d\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u30011\/20\u304f\u3089\u3044\u306b\u66f4\u65b0\u3055\u308c\u305f\u304b\u3069\u3046\u304b\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3002<\/li>\n<\/ul>\n<h5>\u8a2d\u5b9a\u5f8c\u306ecron\u518d\u8d77\u52d5\u306f\u5fc5\u8981\u304b\uff1f<\/h5>\n<blockquote>\n<p>cron \u306e\u5834\u5408\u3001\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u305f\u6642\u70b9\u3067\u3001cron \u304c\u81ea\u52d5\u7684\u306b\u5909\u66f4\u3092\u691c\u77e5\u3059\u308b\u305f\u3081\u3001cron \u30c7\u30fc\u30e2\u30f3\u306e\u518d\u8d77\u52d5\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n<cite><a href=\"http:\/\/landisk.kororo.jp\/diary\/30_cron.php\">\u7b2c30\u56de \u300ccron \u306e\u304a\u52c9\u5f37\u300d<\/a><\/cite><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003URL \u3010Linux\u306e\u30b8\u30e7\u30d6\u30b9\u30b1\u30b8\u30e5\u30fc\u30ea\u30f3\u30b0\u3011cron\u3068at \u3068\u30a2\u30af\u30bb\u30b9\u5236\u5fa1 \u3010\u9055\u3044\u3011\/etc\/crontab\u3068\/var\/spool\/cron\/user &#8211; Qiita<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[53],"tags":[71,48],"class_list":["post-1082","post","type-post","status-publish","format-standard","hentry","category-web","tag-ssl","tag-server"],"_links":{"self":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/comments?post=1082"}],"version-history":[{"count":0,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/posts\/1082\/revisions"}],"wp:attachment":[{"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/media?parent=1082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/categories?post=1082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hi3103.net\/notes\/wp-json\/wp\/v2\/tags?post=1082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}