{"id":3346,"date":"2016-01-24T21:30:16","date_gmt":"2016-01-24T12:30:16","guid":{"rendered":"http:\/\/catsmane.net\/wsblog\/?p=3346"},"modified":"2018-06-27T00:00:36","modified_gmt":"2018-06-26T15:00:36","slug":"%e3%81%95%e3%81%8f%e3%82%89%e3%81%aevps-cron-%e3%81%a7-%e8%87%aa%e5%8b%95%e5%86%8d%e8%b5%b7%e5%8b%95-%e3%81%ae%e5%b7%bb","status":"publish","type":"post","link":"https:\/\/catsmane.net\/wsblog\/?p=3346","title":{"rendered":"\u3055\u304f\u3089\u306eVPS cron \u3067 \u81ea\u52d5 \u518d\u8d77\u52d5 \u306e\u5dfb"},"content":{"rendered":"<p>\u73fe\u5728\u3001\u3053\u306e\u30d6\u30ed\u30b0\u306f\u300c\u3055\u304f\u3089\u306eVPS 2GB SSD\u30d7\u30e9\u30f3\u300d\u3067\u904b\u7528\u3057\u3066\u3044\u307e\u3059\uff01\u305d\u308c\u4ee5\u524d\u306f\u3001\u81ea\u5b85\u30b5\u30fc\u30d0\u30fc\u306eMac mini G4\u541b\u3067\u904b\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u305d\u306e\u30b9\u30da\u30c3\u30af\u304b\u30891\u9031\u9593\u306b1\u56de\u307b\u3069\u518d\u8d77\u52d5\u3055\u305b\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001OS\u304cMac OS X Server\u3060\u3063\u305f\u306e\u3067<\/p>\n<p>GUI\u304b\u3089\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u7ba1\u7406\u3067\u4e88\u7d04\u30ea\u30d6\u30fc\u30c8\u306e\u8a2d\u5b9a\u304c\u51fa\u6765\u3066\u5927\u5909\u4fbf\u5229\u3067\u3057\u305f&#8230;<\/p>\n<p>\u4eca\u56de\u3001\u3055\u304f\u3089\u306eVPS\uff08CentOS6\uff09\u306b\u3066 cron\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066\u81ea\u52d5\u518d\u8d77\u52d5\u306b\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\u3066\u307f\u307e\u3057\u305f\u306e\u3067\u3001\u305d\u306e\u5099\u5fd8\u9332\u3067\u3059\u3002<\/p>\n<h2>\u3055\u304f\u3089\u306eVPS CentOS\u7de8<\/h2>\n<p><a href=\"https:\/\/catsmane.net\/wsblog\/wp-content\/uploads\/2015\/12\/sakura_vps.jpg\" rel=\"attachment wp-att-3933\"><img loading=\"lazy\" class=\"size-medium wp-image-3933 aligncenter\" src=\"https:\/\/catsmane.net\/wsblog\/wp-content\/uploads\/2015\/12\/sakura_vps-320x240.jpg\" alt=\"sakura_vps\" width=\"320\" height=\"240\" srcset=\"https:\/\/catsmane.net\/wsblog\/wp-content\/uploads\/2015\/12\/sakura_vps-320x240.jpg 320w, https:\/\/catsmane.net\/wsblog\/wp-content\/uploads\/2015\/12\/sakura_vps.jpg 800w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/a><\/p>\n<blockquote><p><span style=\"font-size: 14px;\"><strong>cron\u3068\u306f&#8230;<\/strong><\/span><br \/> <span style=\"font-size: 14px;\">\u6c7a\u3081\u3089\u308c\u305f\u6642\u523b\u306b\u30b3\u30de\u30f3\u30c9\u3092\u5b9a\u671f\u7684\u306b\u5b9f\u884c\u3055\u305b\u308b\u305f\u3081\u306e\u30c7\u30fc\u30e2\u30f3\u30d7\u30ed\u30bb\u30b9\u3067\u3059\u3002cron\u3067\u306f\u30b3\u30de\u30f3\u30c9\u3060\u3051\u306b\u3068\u3069\u307e\u3089\u305a\u3001\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3084\u3001Perl\u3084PHP\u306a\u3069\u306e\u30a4\u30f3\u30bf\u30fc\u30d7\u30ea\u30bf\u8a00\u8a9e\u3067\u66f8\u304b\u308c\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3082\u52d5\u4f5c\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/span><\/p><\/blockquote>\n<p>\u3068\u3044\u3046\u4e8b\u306a\u306e\u3067\u3059\u304c&#8230;\u305d\u306e\u524d\u306b<\/p>\n<p style=\"text-align: center;\"><strong>\u518d\u8d77\u52d5\u3063\u3066\u3069\u3046\u3084\u308c\u3070\u826f\u3044\u306e\uff1f<\/strong><\/p>\n<p>\u72b6\u614b\u3060\u3063\u305f\u306e\u3067\u3001\u307e\u305a\u306f\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u518d\u8d77\u52d5\u3092\u3084\u3063\u3066\u307f\u307e\u3057\u3087\u3046\uff01\uff08\u7b11\uff09<\/p>\n<h3>CentOS \u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u518d\u8d77\u52d5<\/h3>\n<p>\u307e\u305a\u306f\u30bf\u30fc\u30df\u30ca\u30eb\u304b\u3089ssh\u3067VPS\u4e0a\u306eCentOS\u3055\u3093\u306b\u30a2\u30af\u30bb\u30b9\uff01root\u6a29\u9650\u304b\u3089\u3067\u306a\u3044\u3068\u518d\u8d77\u52d5\u95a2\u4fc2\u306e\u30b3\u30de\u30f3\u30c9\u304c\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u306e\u3067\u3001\u3042\u3057\u304b\u3089\u305a&#8230;<\/p>\n<h4>shutdown\u30b3\u30de\u30f3\u30c9<\/h4>\n<p>\u305d\u306e\u540d\u306e\u901a\u308aOS\u3092\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\uff08\u96fb\u6e90\u3092\u5207\u308b\u72b6\u614b\u306b\uff09\u3057\u307e\u3059\uff01\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u8272\u3005\u6307\u5b9a\u3067\u304d\u307e\u3059\u304c\u3001\u305d\u306e\u4e2d\u306b\u300c\u518d\u8d77\u52d5\u300d\u304c\u3042\u308a\u307e\u3059\u3088\u3001\u3063\u3068&#8230;<\/p>\n<pre class=\"nums:false lang:default decode:true \">shutdown [ -h | -r ] [ -fqs ] [ now | hh:ss | +mins ] [ message ]<\/pre>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u89e3\u8aac<\/p>\n<pre class=\"nums:false lang:default decode:true\">-h\u3000\u3000\u3000\u3000\u30b7\u30b9\u30c6\u30e0\u3092\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3059\u308b\r\n-r     \u3000\u30b7\u30b9\u30c6\u30e0\u3092\u518d\u8d77\u52d5\u3059\u308b\r\n-f     \u3000\u9ad8\u901f\u6307\u5b9a\u3002\u518d\u8d77\u52d5\u306e\u969b\uff0c\u30d5\u30a1\u30a4\u30eb\u30fb\u30b7\u30b9\u30c6\u30e0\u306e\u30c1\u30a7\u30c3\u30af\u3092\u884c\u308f\u306a\u3044\r\n-q     \u3000\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3057\u306a\u3044\r\n-s     \u3000\u30b7\u30f3\u30b0\u30eb\u30fb\u30e6\u30fc\u30b6\u30fc\u30fb\u30e2\u30fc\u30c9\u3067\u518d\u8d77\u52d5\u3059\u308b\r\nnow    \u3000\u3059\u3050\u306b\u30b7\u30b9\u30c6\u30e0\u306e\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u30fb\u518d\u8d77\u52d5\u3092\u884c\u3046\r\nhh:ss  \u3000\u6307\u5b9a\u3057\u305f\u6642\u9593\u306b\u30b7\u30b9\u30c6\u30e0\u306e\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u30fb\u518d\u8d77\u52d5\u3092\u884c\u3046\r\n+mins  \u3000\u73fe\u5728\u3088\u308a\u6307\u5b9a\u6642\u9593\u5f8c\u306b\u30b7\u30b9\u30c6\u30e0\u306e\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u30fb\u518d\u8d77\u52d5\u3092\u884c\u3046\u3002\u5358\u4f4d\u306f\u5206\r\nmessage\u3000\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u30fb\u518d\u8d77\u52d5\u6642\u306b\u30e6\u30fc\u30b6\u30fc\u306b\u9001\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6307\u5b9a\u3059\u308b<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067<\/p>\n<p>\u518d\u8d77\u52d5\u306f\u300c-r\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u300cnow\u300d\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u7d44\u307f\u5408\u308f\u305b\u3066<\/p>\n<p><strong># shutdown -r now\u3000\u76f4\u3061\u306b\u518d\u8d77\u52d5\uff01\u3053\u308c\u3067OK<\/strong><\/p>\n<p>\u30b3\u30de\u30f3\u30c9\u5165\u529b\u5f8c\u3001\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u307e\u3059\u306e\u3067\u5f53\u305f\u308a\u524d\u3067\u3059\u304c\u4e00\u5ea6\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\uff08\u30bf\u30fc\u30df\u30ca\u30eb\uff09\u306fCentOS\u3055\u3093\u304b\u3089\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u307e\u3059&#8230;.<\/p>\n<p>\u305d\u308d\u305d\u308d\u8d77\u52d5\u3057\u305f\u304b\u306a\uff1f\u3063\u3066\u898b\u8a08\u3089\u3063\u3066\u518d\u5ea6ssh\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u4e0b\u3055\u3044w<\/p>\n<p><span style=\"font-size: 12px;\">\u9593\u9055\u3063\u3066# shutdown -h now \u300cr\u300d\u3068\u300ch\u300d\u3092\u52d8\u9055\u3044\u3057\u3066\u3057\u307e\u3046\u3068\u518d\u8d77\u52d5\u3067\u306f\u306a\u304f\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u3066\u3057\u307e\u3044\u307e\u3059\uff01\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u306f\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u4ee5\u5f8c\u7acb\u3061\u4e0a\u304c\u308a\u307e\u305b\u3093\uff08\u7b11\uff09\u3055\u304f\u3089\u306eVPS\u306e\u5834\u5408\u3001WEB\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb\u30d1\u30cd\u30eb\u304b\u3089VPS\u3092\u8d77\u52d5\u3057\u306a\u304a\u3055\u306a\u3044\u3068\u3044\u3051\u307e\u305b\u3093&#8230;\u3082\u3061\u308d\u3093\u7d4c\u9a13\u6e08\u307f\u3067\u3059\uff08\u7b11\uff09<\/span><\/p>\n<p><strong># shutdown -h 0:0\u3000\u3053\u308c\u306f0\u6642\u306b\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3059\u308b\uff01\u3067\u3059&#8230;<\/strong><\/p>\n<p>\u4e88\u7d04\u307f\u305f\u3044\u306a\u611f\u3058\u3067\u3059\u304b\u306d\uff1f\u518d\u8d77\u52d5\u306e\u5ea6\u306b\u6bce\u56de\u3001\u6642\u9593\u6307\u5b9a\u3067 shutdown -r 0:0 \u30b3\u30de\u30f3\u30c9\u3092\u6253\u3063\u3066\u3082\u826f\u3044\u3067\u3059\u304c\uff08\u826f\u3044\u308f\u3051\u304c\u306a\u3044\uff09\u6bce\u56de\u6c7a\u307e\u3063\u305f\u6642\u9593\u306b\u81ea\u52d5\u3067\u5b9f\u884c\u3067\u304d\u305f\u3089\u4fbf\u5229\u3067\u3059\u3088\u306d\uff1f<\/p>\n<p><strong>\u306f\u3044\u3001\u305d\u3053\u3067\u300ccron\u300d\u3055\u3093\u306e\u767b\u5834\u3067\u3059\uff08\u7b11\uff09<\/strong><\/p>\n<p>\u3061\u306a\u307f\u306b<\/p>\n<h4>reboot\u30b3\u30de\u30f3\u30c9<\/h4>\n<p>\u3053\u3093\u306a\u30b3\u30de\u30f3\u30c9\u3082\u3042\u3063\u3066\u610f\u5473\u306f\u300c\u30b7\u30b9\u30c6\u30e0\u3092\u3059\u3050\u306b\u518d\u8d77\u52d5\u3059\u308b\u300d\u3067\u3059\u3002<\/p>\n<p style=\"text-align: center;\"><strong>shutdown -r -q now\u3000\u3068\u540c\u3058\u610f\u5473\u306b\u306a\u308a\u307e\u3059&#8230;<\/strong><\/p>\n<p>\u3068\u3001\u57fa\u672c\u30b3\u30de\u30f3\u30c9\u306e\u8aac\u660e\u3092\u78ba\u8a8d\u3057\u305f\u3068\u3053\u308d\u3067<\/p>\n<p>\u3055\u3063\u305d\u304f\u300ccron\u300d\u3055\u3093\u306e\u8a2d\u5b9a\u3067\u3059\uff01<\/p>\n<h3>CentOS \u3067 cron \u3092 \u8a2d\u5b9a\u3059\u308b\u6d41\u308c<\/h3>\n<pre class=\"nums:false lang:default decode:true\">\/\/ root\u6a29\u9650\u306b\u79fb\u884c\r\nsudo -s\r\n\r\n\/\/ cron\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u304b\u78ba\u8a8d\r\n# service crond status\r\ncrond (pid\u00a0 1612) \u3092\u5b9f\u884c\u4e2d... \r\n\r\n\/\/ \u505c\u6b62\u3057\u3066\u3044\u308b\u5834\u5408\u306fcron\u306e\u8d77\u52d5\r\n# service crond start\r\n\r\n\/\/ \u30b7\u30b9\u30c6\u30e0\u8d77\u52d5\u6642\u306b\u81ea\u52d5\u8d77\u52d5\r\n# chkconfig crond on\r\n\r\n\/\/ \u81ea\u52d5\u8d77\u52d5\u8a2d\u5b9a\u306e\u78ba\u8a8d\r\n# chkconfig --list crond\r\n\r\ncrond          0:off    1:off    2:on    3:on    4:on    5:on    6:off\r\n<\/pre>\n<p style=\"text-align: center;\"><strong>3:on \u306a\u306e\u3067\u81ea\u52d5\u8d77\u52d5\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u308b\u4e8b\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\uff01<\/strong><\/p>\n<p>\u3053\u308c\u3067\u300ccron\u300d\u3055\u3093\u304c\u8d77\u52d5\u3057\u3066\u3044\u3066\u3001\u306a\u304a\u304b\u3064\u518d\u8d77\u52d5\u5f8c\u3082\u300ccron\u300d\u3055\u3093\u304c\u81ea\u52d5\u3067\u8d77\u52d5\u3059\u308b\u4e8b\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u306d\uff1f\u305d\u308c\u3067\u306f\u3001\u6b21\u306b\u5b9f\u969b\u306b\u300ccron\u300d\u3055\u3093\u3092\u4f7f\u7528\u3059\u308b\u308f\u3051\u3067\u3059\u304c&#8230;<\/p>\n<p>\u57fa\u672c\u306f \/var\/spool\/\u5185\u306e cron\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4e2d\u306b\u300ccron\u300d\u3055\u3093\u306b\u3084\u3063\u3066\u3082\u3089\u3044\u305f\u3044\u4e8b\u3092\u8a18\u8ff0\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u4e8b\u306b\u3088\u3063\u3066\u300ccron\u300d\u3055\u3093\u3092\u4f7f\u7528\u3057\u307e\u3059&#8230;<\/p>\n<p>\u3053\u3053\u3067\u306f crontab\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u76f4\u63a5\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059&#8230;<\/p>\n<h4>crontab\u30b3\u30de\u30f3\u30c9<\/h4>\n<pre class=\"&quot;nums:false\" lang:default=\"\" decode:true=\"\">crontab [ -u \u30e6\u30fc\u30b6\u540d ] { -l | -r | -e }<\/pre>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u89e3\u8aac<\/p>\n<pre class=\"nums:false lang:default decode:true \">-u \u30e6\u30fc\u30b6\u306e\u6307\u5b9a\u3001\u7701\u7565\u3057\u305f\u5834\u5408\u306f\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u30e6\u30fc\u30b6\u3067\u8a2d\u5b9a\u3055\u308c\u307e\u3059\r\n\r\n-l \u73fe\u5728\u306e crontab \u3092\u6a19\u6e96\u51fa\u529b\u3078\u8868\u793a\u3055\u307e\u3059\r\n\r\n-r \u73fe\u5728\u306e crontab \u3092\u524a\u9664\u3059\u308b\r\n\r\n-e \u6307\u5b9a\u3055\u308c\u3066\u3044\u308b\u30a8\u30c7\u30a3\u30bf\u30fc\u3092\u4f7f\u7528\u3057\u3066\u73fe\u5728\u306e crontab \u3092\u7de8\u96c6\u3059\u308b\u306e\u306b\u4f7f\u308f\u308c\u307e\u3059\u3002<\/pre>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u300c-r\u300d\u306f\u3001cron\u3055\u3093\u306e\u8a2d\u5b9a\u3092\u901f\u653b\u3067\u5168\u90e8\u6d88\u3057\u3061\u3083\u3046\u3089\u3057\u3044\u306e\u3067<\/p>\n<p style=\"text-align: center;\"><strong>\u5371\u967a\u3067\u3059\uff01\u6ce8\u610f\u3067\u3059\uff01\uff08\u7206\uff09<\/strong><\/p>\n<p>\u4f55\u5ea6\u3082\u66f8\u304d\u307e\u3059\u304c&#8230;\u300c-r\u300d \u30aa\u30d7\u30b7\u30e7\u30f3\u306f\u3001\u73fe\u5728\u306e crontab \u306e\u8a2d\u5b9a\u3092\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3063\u305f\u77ac\u9593\u306b\u524a\u9664\u3057\u307e\u3059 \uff1d \u4f55\u3082\u78ba\u8a8d\u3055\u308c\u305a\u306b\u524a\u9664\u3055\u308c\u308b\u306e\u3067<\/p>\n<p style=\"text-align: center;\"><strong>\u4f7f\u7528\u306b\u306f\u5341\u5206\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\uff01<\/strong><\/p>\n<p>\u300ce\u300d\u3068\u300cr\u300d\u306f\u30ad\u30fc\u30dc\u30fc\u30c9\u4e0a\u3067\u96a3\u3042\u308f\u305b\u306a\u306e\u3067\u3001\u9593\u9055\u3063\u3066\u62bc\u3057\u3066\u3057\u307e\u3063\u3066\u7de8\u96c6\u3057\u3088\u3046\u3068\u3057\u3066\u5168\u90e8\u524a\u9664\u3057\u3066\u3057\u307e\u3063\u305f\u3068\u3044\u3046\u60b2\u60e8\u306a\u4e8b\u4ef6\u304c\u5404\u5730\u3067\u767a\u751f\u3057\u3066\u3044\u308b\u6a21\u69d8\u3067\u3059&#8230;<\/p>\n<p><span style=\"font-size: 12px;\">\uff08\u4e0a\u8a18\u306e\u7406\u7531\u3067 crontab -e\u306f\u4f7f\u7528\u3057\u306a\u3044\uff01\u3068\u3044\u3046\u6975\u8ad6\u307e\u3067\u3042\u308b\u3089\u3057\u3044\u306e\u3067\u3059\uff09<\/span><\/p>\n<p>\u305d\u3093\u306a\u4e8b\u614b\u306b\u9665\u3089\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u306e\u65b9\u6cd5\u3082\u3042\u308b\u3089\u3057\u3044\u3067\u3059\u304c\u3001\u305d\u306e\u3046\u3061\u52c9\u5f37\u3057\u3066\u307f\u307e\u3059&#8230;\u4eca\u306f\u53b3\u91cd\u6ce8\u610f\u3067crontab\u3092\u4f7f\u7528\u4e2d\u3067\u3059\uff08\u7b11\uff09<\/p>\n<p>\u3061\u306a\u307f\u306b<\/p>\n<p style=\"text-align: center;\"><span class=\"COMMAND\"><b>-i \u30aa\u30d7\u30b7\u30e7\u30f3<\/b><\/span><\/p>\n<p><span class=\"COMMAND\">-i\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u3044\u3046\u306e\u304c\u3042\u3063\u3066\u3001<\/span>\u3053\u308c\u3092\u4ed8\u3051\u3066\u304a\u304f\u3068\u524a\u9664\u3059\u308b\u524d\u306b\u300c\u30db\u30f3\u30c8\u306b\u6d88\u3059\u306e\uff1f\u300d\u3063\u3066\u805e\u3044\u3066\u304f\u308c\u307e\u3059&#8230;<\/p>\n<p>#crontab -ir<br \/> crontab: really delete root&#8217;s crontab?<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3001\u3053\u306e\u5f8c\u306b\u672c\u5f53\u306b\u524a\u9664\u3059\u308b\u306a\u3089\u300cy\u300d\u300cyes\u300d\u3057\u306a\u3044\u306a\u3089\u300cn\u300d\u300cno\u300d\u3068\u6253\u8fbc\u3080\u307e\u3067\u4e00\u6642\u51e6\u7406\u3092\u4e2d\u65ad\u3057\u3066\u304f\u308c\u307e\u3059\u304c&#8230;<\/p>\n<p style=\"text-align: center;\"><strong>\u300c-i\u300d\u3092\u4ed8\u3051\u308b\u306e\u5fd8\u308c\u305f\u3089\u610f\u5473\u304c\u3042\u308a\u307e\u305b\u3093\u306d&#8230;orz<\/strong><\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\u91cd\u3005\u6ce8\u610f\uff08\u7b11\uff09\u3057\u306a\u304c\u3089 crontab\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u307f\u307e\u3059&#8230;\u30a8\u30c7\u30a3\u30bf\u30fc\uff08vi\uff1f\uff09\u304c\u7acb\u3061\u4e0a\u304c\u308a\u307e\u3059\u306e\u3067\u65e2\u8ff0\u5f8c\u306b\u4fdd\u5b58\u3057\u3066\u7d42\u4e86\u3067\u3059\uff01<\/p>\n<pre class=\"nums:false lang:default decode:true \"># crontab -e\r\n00 4 * * * \/sbin\/shutdown -r now<\/pre>\n<p>\u4f8b\u3067\u306f\u300c-u\u300d\u7701\u7565\u3001 root \u3067 crontab \u3092\u5b9f\u884c\u3057\u305f\u306e\u3067 \/var\/spool\/cron \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b root \u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4e0a\u8a18\u306e\u5185\u5bb9\u3067\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059&#8230;<\/p>\n<p><strong>\u3061\u306a\u307f\u306b\u300c\u6bce\u65e5AM4:00\u306b\u518d\u8d77\u52d5\u3057\u3066\u306d\u300d\u3063\u3066\u5185\u5bb9\u3067\u3059\uff01<\/strong><\/p>\n<pre class=\"nums:false lang:default decode:true\">\/\/ \u6bce\u65e5 am5:45 \u518d\u8d77\u52d5\u3060\u3063\u305f\u3089\r\n45 5 * * * \/sbin\/shutdown -r now\r\n\r\n\/\/ \u6bce\u65e5 am3:00 apache \u306e\u30ea\u30b9\u30bf\u30fc\u30c8\u3060\u3063\u305f\u3089...\r\n00 3 * * * service httpd rstart<\/pre>\n<p class=\"\">\u5206\u3000\u6642\u3000\u65e5\u3000\u6708\u3000\u66dc\u65e5\u3000\u30b3\u30de\u30f3\u30c9 \u306e\u9806\u756a\u3067\u8a18\u8ff0\u3059\u308b\u69d8\u3067\u3059\u3088&#8230;<\/p>\n<p class=\"\">\u3061\u306a\u307f\u306b\u66dc\u65e5\u306f0-7 (0\u307e\u305f\u306f7\u306f\u65e5\u66dc\u65e5\uff09\u3067\u8868\u8a18\u3057\u307e\u3059\uff01<br \/> 0=\u65e5\u30011=\u6708\u30012=\u706b\u30013=\u6c34\u30014=\u6728\u30015=\u91d1\u30016=\u571f\u30017=\u65e5 \u3067\u3059\u3002<\/p>\n<p class=\"\"><strong>\u3053\u3053\u3067\u5fa9\u7fd2\u3067\u3059&#8230;<\/strong><\/p>\n<pre class=\"nums:false lang:default decode:true\">\/\/ cron\u3067\u8a2d\u5b9a\u3055\u308c\u305f\u5185\u5bb9\u306e\u78ba\u8a8d\u306f\r\n# crontab -l\r\n45 5 * * * \/sbin\/shutdown -r now\r\n\r\n\/\/ \u8a2d\u5b9a\u3055\u308c\u305f\u6570\u3092\u78ba\u8a8d\r\n# ls -l \/var\/spool\/cron\r\n\r\n\/\/ \u30a8\u30c7\u30a3\u30bf\u30fc\u3067\u7de8\u96c6\r\n# crontab -e\r\n\r\n\/\/ \u30d5\u30a1\u30a4\u30eb\u306e\u3042\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\r\n\/var\/spool\/cron\/\r\n\r\n\/\/ \u73fe\u5728\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u5185\u5bb9\u3092\u524a\u9664\uff08\u78ba\u8a8d\u3042\u308a\uff09\r\ncrontab -ir\r\n<\/pre>\n<p>\u8a18\u8ff0\u5f8c\u306f\u300ccron\u300d\u3055\u3093\u3092\u518d\u8d77\u52d5\uff08service crond restart\uff09\u3057\u3066<\/p>\n<p><strong>\u6e96\u5099OK\u3067\u3059\uff01<\/strong><\/p>\n<pre class=\"nums:false lang:default decode:true\">\/\/ cron\u306e\u518d\u8d77\u52d5\r\nservice crond restart<\/pre>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u4eca\u56de\u3001CentOS\u3055\u3093\u3092\u6bce\u65e5am5:45\u306b\u81ea\u52d5\u3067\u518d\u8d77\u52d5\u3059\u308b\u8a2d\u5b9a\u3092\u3057\u3066\u307f\u307e\u3057\u305f\uff01\u4eca\u306e\u6240\u3001\u554f\u984c\u306a\u304f\u6bce\u65e5\u518d\u8d77\u52d5\u3057\u3066\u304f\u308c\u3066\u3044\u307e\u3059\uff01<\/p>\n<h3>cron \u5c65\u6b74\u306e\u78ba\u8a8d \u30ed\u30b0\u30d5\u30a1\u30a4\u30eb<\/h3>\n<p>\u518d\u8d77\u52d5\u306e\u5c65\u6b74\u3068\u3044\u3046\u304b\u300ccron\u300d\u3055\u3093\u306e\u5b9f\u884c\u5c65\u6b74\u306f \/var\/log\/ \u306b\u3042\u308b cron\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067log\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<p>\u300ccron\u300d\u3055\u3093\u304c\u5b9a\u6642\u3067\u4f55\u3092\u3084\u3063\u3066\u3044\u308b\u306e\u304b\uff1f\u308f\u304b\u308a\u307e\u3059\uff01<\/p>\n<pre class=\"nums:false lang:default decode:true\">Dec 21 05:40:01 ik1-308-14445 CROND[5217]: (root) CMD (\/usr\/lib64\/sa\/sa1 1 1)\r\nDec 21 05:45:01 ik1-308-14445 CROND[5221]: (root) CMD (\/sbin\/shutdown -r now)\r\nDec 21 05:45:08 ik1-308-14445 crond[1634]: (CRON) INFO (Shutting down)\r\nDec 21 05:45:56 ik1-308-14445 crond[1625]: (CRON) STARTUP (1.4.4)\r\n<\/pre>\n<p>\u30ad\u30c1\u30f3\u3068 AM5:45 \u306b root \u3067 shutdown -r now \u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u307e\u3059\u306d\uff01\uff1f cron\u3055\u3093\u3067\u306f\u4ed6\u306b\u6642\u9593\u6307\u5b9a\u306e\u66f8\u5f0f\u304c\u8272\u3005\u3042\u308b\u69d8\u3067\u3059\u306e\u3067<\/p>\n<p>\u8208\u5473\u306e\u3042\u308b\u65b9\u306fWEB\u3067\u691c\u7d22\u3057\u3066\u307f\u3066\u4e0b\u3055\u3044w<\/p>\n<p><span style=\"font-size: 12px;\">\u30b9\u30dd\u30f3\u30b5\u30fc\u30ea\u30f3\u30af<\/span><\/p>\n<div class=\"kiziad\" style=\"margin-bottom:20px;\">\n  <div class=\"adleft\">\n    <script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n\t<!-- google ad big -->\n\t<ins class=\"adsbygoogle\"\n\t     style=\"display:inline-block;width:336px;height:280px\"\n\t     data-ad-client=\"ca-pub-9677987666175134\"\n\t     data-ad-slot=\"3315807609\"><\/ins>\n\t<script>\n    \t (adsbygoogle = window.adsbygoogle || []).push({});\n\t<\/script>\n  <\/div>\n  <div class=\"adright\">\n  <script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\n\t<!-- google ad big -->\n\t<ins class=\"adsbygoogle\"\n\t     style=\"display:inline-block;width:336px;height:280px\"\n\t     data-ad-client=\"ca-pub-9677987666175134\"\n\t     data-ad-slot=\"3315807609\"><\/ins>\n\t<script>\n    \t (adsbygoogle = window.adsbygoogle || []).push({});\n\t<\/script>\n  <\/div>\n  <hr class=\"clear\">\n<!-- \/ .kiziad --><\/div><aside class=\"row veu_insertAds after\"><div class=\"col-md-6\">\u4e00\u7dd2\u306b\u30d6\u30ed\u30b0\u754c\u3092\u76db\u308a\u4e0a\u3052\u3088\u3046\uff01\r\n<table style=\"border-style: none;\" border=\"1\">\r\n<tbody>\r\n<tr>\r\n<td style=\"border-style: none;\"><span style=\"font-size: 12px;\">\u306b\u307b\u3093\u30d6\u30ed\u30b0\u6751<\/span><\/td>\r\n<td style=\"border-style: none;\"><span style=\"font-size: 12px;\">BLOG RANKING<\/span><\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-style: none;\"><a href=\"https:\/\/car.blogmura.com\/bmw\/ranking.html?p_cid=10772544\"><img src=\"\/\/car.blogmura.com\/bmw\/img\/bmw88_31.gif\" alt=\"\u306b\u307b\u3093\u30d6\u30ed\u30b0\u6751 \u8eca\u30d6\u30ed\u30b0 BMW\uff08\u8eca\uff09\u3078\" width=\"88\" height=\"31\" border=\"0\" ><\/a><span style=\"font-size: 12px;\">\uff08\u8eca\uff09<\/span><\/td>\r\n<td style=\"border-style: none;\"><a title=\"\u81ea\u52d5\u8eca(BMW) \u30d6\u30ed\u30b0\u30e9\u30f3\u30ad\u30f3\u30b0\u3078\" href=\"\/\/blog.with2.net\/link.php?1560403:1597\"><img src=\"\/\/blog.with2.net\/img\/banner\/c\/banner_1\/br_c_1597_1.gif\" width=\"110\" height=\"31\" border=\"0\" ><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-style: none;\"><a href=\"https:\/\/bike.blogmura.com\/bmwbike\/ranking.html?p_cid=10772544\"><img src=\"\/\/bike.blogmura.com\/bmwbike\/img\/bmwbike88_31.gif\" width=\"88\" height=\"31\" border=\"0\" alt=\"\u306b\u307b\u3093\u30d6\u30ed\u30b0\u6751 \u30d0\u30a4\u30af\u30d6\u30ed\u30b0 BMW\uff08\u30d0\u30a4\u30af\uff09\u3078\" \/><\/a><span style=\"font-size: 12px;\">\uff08\u30d0\u30a4\u30af\uff09<\/span><\/td>\r\n<td style=\"border-style: none;\"><a title=\"Macintosh \u30d6\u30ed\u30b0\u30e9\u30f3\u30ad\u30f3\u30b0\u3078\" href=\"\/\/blog.with2.net\/link.php?1560403:1014\"><img src=\"\/\/blog.with2.net\/img\/banner\/c\/banner_1\/br_c_1014_1.gif\" width=\"110\" height=\"31\" border=\"0\" ><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n<td style=\"border-style: none;\"><a href=\"https:\/\/photo.blogmura.com\/digitalslrcamera_nikon\/ranking.html?p_cid=10772544\"><img src=\"\/\/photo.blogmura.com\/digitalslrcamera_nikon\/img\/digitalslrcamera_nikon88_31.gif\" width=\"88\" height=\"31\" border=\"0\" alt=\"\u306b\u307b\u3093\u30d6\u30ed\u30b0\u6751 \u5199\u771f\u30d6\u30ed\u30b0 \u30c7\u30b8\u30bf\u30eb\u4e00\u773c\uff08Nikon\uff09\u3078\" \/><\/a><\/td>\r\n<td style=\"border-style: none;\"><a title=\"\u30c4\u30fc\u30ea\u30f3\u30b0\u65e5\u8a18\u30e9\u30f3\u30ad\u30f3\u30b0\" href=\"\/\/blog.with2.net\/link\/?1560403:2709\"><img src=\"\/\/blog.with2.net\/img\/banner\/c\/banner_1\/br_c_2709_1.gif\" width=\"110\" height=\"31\" border=\"0\"><\/a><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table><\/div><div class=\"col-md-6\"><!-- Rakuten Widget FROM HERE --><script type=\"text\/javascript\">rakuten_design=\"slide\";rakuten_affiliateId=\"08715f48.3b9b34ad.08715f49.6abb241e\";rakuten_items=\"ctsmatch\";rakuten_genreId=\"0\";rakuten_size=\"336x280\";rakuten_target=\"_blank\";rakuten_theme=\"gray\";rakuten_border=\"off\";rakuten_auto_mode=\"on\";rakuten_genre_title=\"off\";rakuten_recommend=\"on\";rakuten_ts=\"1547628772883\";<\/script><script type=\"text\/javascript\" src=\"https:\/\/xml.affiliate.rakuten.co.jp\/widget\/js\/rakuten_widget.js\"><\/script><\/div><\/aside><div class=\"veu_socialSet veu_socialSet-position-after veu_contentAddSection\"><script>window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src=\"https:\/\/platform.twitter.com\/widgets.js\";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,\"script\",\"twitter-wjs\"));<\/script><ul><li class=\"sb_facebook sb_icon\"><a class=\"sb_icon_inner\" href=\"\/\/www.facebook.com\/sharer.php?src=bm&u=https%3A%2F%2Fcatsmane.net%2Fwsblog%2F%3Fp%3D3346&amp;t=%E7%A6%81%E6%96%AD%E3%81%AE%E6%9E%9C%E5%AE%9F\" target=\"_blank\" onclick=\"window.open(this.href,'FBwindow','width=650,height=450,menubar=no,toolbar=no,scrollbars=yes');return false;\"><span class=\"vk_icon_w_r_sns_fb icon_sns\"><\/span><span class=\"sns_txt\">Facebook<\/span><span class=\"veu_count_sns_fb\"><\/span><\/a><\/li><li class=\"sb_twitter sb_icon\"><a class=\"sb_icon_inner\" href=\"\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fcatsmane.net%2Fwsblog%2F%3Fp%3D3346&amp;text=%E7%A6%81%E6%96%AD%E3%81%AE%E6%9E%9C%E5%AE%9F\" target=\"_blank\" ><span class=\"vk_icon_w_r_sns_twitter icon_sns\"><\/span><span class=\"sns_txt\">twitter<\/span><\/a><\/li><li class=\"sb_hatena sb_icon\"><a class=\"sb_icon_inner\" href=\"\/\/b.hatena.ne.jp\/add?mode=confirm&url=https%3A%2F%2Fcatsmane.net%2Fwsblog%2F%3Fp%3D3346&amp;title=%E7%A6%81%E6%96%AD%E3%81%AE%E6%9E%9C%E5%AE%9F\" target=\"_blank\"  onclick=\"window.open(this.href,'Hatenawindow','width=650,height=450,menubar=no,toolbar=no,scrollbars=yes');return false;\"><span class=\"vk_icon_w_r_sns_hatena icon_sns\"><\/span><span class=\"sns_txt\">Hatena<\/span><span class=\"veu_count_sns_hb\"><\/span><\/a><\/li><li class=\"sb_pocket sb_icon\"><a class=\"sb_icon_inner\"  href=\"\/\/getpocket.com\/edit?url=https%3A%2F%2Fcatsmane.net%2Fwsblog%2F%3Fp%3D3346&title=%E7%A6%81%E6%96%AD%E3%81%AE%E6%9E%9C%E5%AE%9F\" target=\"_blank\"  onclick=\"window.open(this.href,'Pokcetwindow','width=650,height=450,menubar=no,toolbar=no,scrollbars=yes');return false;\"><span class=\"vk_icon_w_r_sns_pocket icon_sns\"><\/span><span class=\"sns_txt\">Pocket<\/span><span class=\"veu_count_sns_pocket\"><\/span><\/a><\/li><li class=\"sb_copy sb_icon\"><button class=\"copy-button sb_icon_inner\"data-clipboard-text=\"\u7981\u65ad\u306e\u679c\u5b9f https:\/\/catsmane.net\/wsblog\/?p=3346\"><span class=\"vk_icon_w_r_sns_copy icon_sns\"><i class=\"fas fa-copy\"><\/i><\/span><span class=\"sns_txt\">Copy<\/span><\/button><\/li><\/ul><\/div><!-- [ \/.socialSet ] -->","protected":false},"excerpt":{"rendered":"<p>\u73fe\u5728\u3001\u3053\u306e\u30d6\u30ed\u30b0\u306f\u300c\u3055\u304f\u3089\u306eVPS 2GB SSD\u30d7\u30e9\u30f3\u300d\u3067\u904b\u7528\u3057\u3066\u3044\u307e\u3059\uff01\u305d\u308c\u4ee5\u524d\u306f\u3001\u81ea\u5b85\u30b5\u30fc\u30d0\u30fc\u306eMac mini G4\u541b\u3067\u904b\u7528\u3057\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u305d\u306e\u30b9\u30da\u30c3\u30af\u304b\u30891\u9031\u9593\u306b1\u56de\u307b\u3069\u518d\u8d77\u52d5\u3055\u305b\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001OS\u304cMac  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3933,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"gallery","meta":{"vkexunit_cta_each_option":""},"categories":[367],"tags":[411,422],"_links":{"self":[{"href":"https:\/\/catsmane.net\/wsblog\/index.php?rest_route=\/wp\/v2\/posts\/3346"}],"collection":[{"href":"https:\/\/catsmane.net\/wsblog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/catsmane.net\/wsblog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/catsmane.net\/wsblog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/catsmane.net\/wsblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3346"}],"version-history":[{"count":0,"href":"https:\/\/catsmane.net\/wsblog\/index.php?rest_route=\/wp\/v2\/posts\/3346\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/catsmane.net\/wsblog\/index.php?rest_route=\/wp\/v2\/media\/3933"}],"wp:attachment":[{"href":"https:\/\/catsmane.net\/wsblog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/catsmane.net\/wsblog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/catsmane.net\/wsblog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}