{"id":3522,"date":"2018-05-27T18:54:43","date_gmt":"2018-05-27T09:54:43","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=3522"},"modified":"2023-05-27T21:22:57","modified_gmt":"2023-05-27T12:22:57","slug":"%e3%80%90linux%e3%80%91%e3%83%ad%e3%82%b0%e7%ae%a1%e7%90%86","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=3522","title":{"rendered":"\u3010Linux\u3011\u300c\u30ed\u30b0\u306e\u7a2e\u985e\u300d\u3068\u300c\u30ed\u30b0\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u300d\u3001\u300ccron(\u30af\u30fc\u30ed\u30f3)\u300d\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>\u30ed\u30b0\u3068\u306f\uff1f<\/h2>\n<p>\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3084OS\u306b\u7570\u5e38\u304c\u306a\u3044\u304b\u7b49\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u30b7\u30b9\u30c6\u30e0\u904b\u7528\u3060\u3051\u3067\u306a\u304f\u3001\u69cb\u7bc9\u6642\u7b49\u3082\u4f55\u304b\u3068\u304a\u4e16\u8a71\u306b\u306a\u308b\u77e5\u8b58\u3060\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u7d76\u5bfe\u306b\u6291\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/strong><\/span><\/p>\n<h2>Linux\u306b\u304a\u3051\u308b\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u7a2e\u985e<\/h2>\n<table>\n<tbody>\n<tr>\n<th>\u30ed\u30b0\u306e\u7a2e\u985e<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>\/var\/log\/boot.log<\/td>\n<td>\u30ab\u30fc\u30cd\u30eb\u8d77\u52d5\u6642\u306e\u30ed\u30b0<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/cron<\/td>\n<td>cron\u306e\u51e6\u7406\u306b\u95a2\u3059\u308b\u30ed\u30b0<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/dmesg<\/td>\n<td>\u30ab\u30fc\u30cd\u30eb\u3084\u30c9\u30e9\u30a4\u30d0\u304b\u3089\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30ed\u30b0<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/lastlog<\/td>\n<td>\u76f4\u524d\u306e\u30ed\u30b0\u30a4\u30f3\u306b\u3064\u3044\u3066\u306e\u30ed\u30b0<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/messages<\/td>\n<td>\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u306e\u30ed\u30b0<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/secure<\/td>\n<td>\u8a8d\u8a3c\u306b\u95a2\u3059\u308b\u30ed\u30b0<\/td>\n<\/tr>\n<tr>\n<td>\/var\/log\/wtmp<\/td>\n<td>\u30ed\u30b0\u30a4\u30f3\u306b\u95a2\u3059\u308b\u30ed\u30b0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u30ed\u30b0\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066<\/h2>\n<p>\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306f\u65e5\u306b\u65e5\u306b\u80a5\u5927\u5316\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u306a\u306e\u3067\u3001\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3059\u308b\u30ed\u30b0\u3084\u3001\u524a\u9664\u3059\u308b\u30ed\u30b0\u306e\u6570\u7b49\u3092Linux\u3067\u306f\u300c\/etc\/logrotate.conf\u300d\u3067\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u3001Linux\u3067\u306f\u3001<span style=\"color: #ff0000;\"><strong>\u300c\u30ed\u30b0\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u300d<\/strong><\/span>\u3068\u547c\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001wtmp\u30d5\u30a1\u30a4\u30eb\uff08\u30ed\u30b0\u30a4\u30f3\u306b\u95a2\u3059\u308b\u30ed\u30b0\uff09\u306e\u30ed\u30b0\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3<\/p>\n<pre class=\"lang:default decode:true\"># no packages own wtmp and btmp -- we'll rotate them here\r\n\/var\/log\/wtmp {\u3000\u2190\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u540d\r\n    monthly\u3000\u3000\u3000\u3000\u2190\u6708\u3054\u3068\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\r\n    create 0664 root utmp\u3000\u2190\u5de6\u304b\u3089\u3001\u300c\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u306e\u8a2d\u5b9a\u5024\u300d\u3001\u300c\u4f5c\u6210\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u300d\u3001\u300c\u4f5c\u6210\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u30e6\u30fc\u30b6\u30fc\u300d\u3001\u300c\u4f5c\u6210\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u30b0\u30eb\u30fc\u30d7\u300d\r\n        minsize 1M\u3000\u2190\u30b5\u30a4\u30ba\u304c\uff11\uff2d\u3092\u8d85\u3048\u305f\u5834\u5408\u306f\u3001\u30ed\u30fc\u30c6\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u3002\r\n    rotate 1\u3000\u2190\uff11\u3064\u3060\u3051\u6b8b\u3059\u3002\r\n}<\/pre>\n<h2>cron(\u30af\u30fc\u30ed\u30f3)\u306e\u57fa\u672c<\/h2>\n<p>Linux\u3067\u3082\u3001\u6307\u5b9a\u3057\u305f\u65e5\u6642\u306b\u6307\u5b9a\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u4ed5\u7d44\u307f\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u308c\u304c\u3001<span style=\"color: #ff0000;\"><strong>cron(\u30af\u30fc\u30ed\u30f3)<\/strong><\/span>\u3067\u3059\u3002\uff08\u30af\u30ed\u30fc\u30f3\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3088\u3000\u7b11\uff09cron\u306f1\u3064\u306e\u5e38\u4f4f\u30d7\u30ed\u30bb\u30b9\u3068\u3057\u3066\u52d5\u4f5c\u3057\u307e\u3059\u3002<\/p>\n<h3>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb<\/h3>\n<p>\u300c\/etc\/crontab\u300d\u304ccron\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-3505\" src=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/05\/crontab.png\" alt=\"\" width=\"705\" height=\"305\" srcset=\"http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/05\/crontab.png 705w, http:\/\/www.code-magagine.com\/wp-content\/uploads\/2018\/05\/crontab-300x130.png 300w\" sizes=\"(max-width: 705px) 100vw, 705px\" \/><\/p>\n<p>\u5de6\u304b\u3089\u4e0b\u8a18\u306e\u8a2d\u5b9a\u3092\u884c\u3048\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u8a2d\u5b9a\u5024<\/th>\n<\/tr>\n<tr>\n<td>\u5206<\/td>\n<\/tr>\n<tr>\n<td>\u6642<\/td>\n<\/tr>\n<tr>\n<td>\u65e5<\/td>\n<\/tr>\n<tr>\n<td>\u6708<\/td>\n<\/tr>\n<tr>\n<td>\u66dc\u65e5(0\uff5e7\uff1a\u65e5\u66dc\u65e5\u306f0 or 7\u306b\u306a\u308a\u307e\u3059\u3002\uff09<\/td>\n<\/tr>\n<tr>\n<td>\u5b9f\u884c\u30e6\u30fc\u30b6\u30fc<\/td>\n<\/tr>\n<tr>\n<td>\uff1f<\/td>\n<\/tr>\n<tr>\n<td>\u30d5\u30a1\u30a4\u30eb\u4fdd\u7ba1\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff08\u4e2d\u306b\u3042\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u30d5\u30a1\u30a4\u30eb\u3084\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30ea\u30f3\u30af\u304c\u5b9f\u884c\u5bfe\u8c61\u3068\u306a\u308a\u307e\u3059\u3002\uff09\u3001\u3082\u3057\u304f\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u305d\u306e\u307e\u307e\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u5b9f\u884c\u30d7\u30ed\u30b0\u30e9\u30e0<\/h3>\n<p>crond\u3068\u3044\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u30ed\u30b0\u3068\u306f\uff1f \u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3084OS\u306b\u7570\u5e38\u304c\u306a\u3044\u304b\u7b49\u3092\u78ba\u8a8d\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002 \u30b7\u30b9\u30c6\u30e0\u904b\u7528\u3060\u3051\u3067\u306a\u304f\u3001\u69cb\u7bc9\u6642\u7b49\u3082\u4f55\u304b\u3068\u304a\u4e16\u8a71\u306b\u306a\u308b\u77e5\u8b58\u3060\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u7d76\u5bfe\u306b\u6291\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002 Linux\u306b\u304a\u3051\u308b\u30ed\u30b0\u30d5\u30a1\u30a4\u30eb\u306e\u7a2e\u985e \u30ed\u30b0\u306e [&hellip;]","protected":false},"author":1,"featured_media":3429,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[39],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/3522"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3522"}],"version-history":[{"count":9,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/3522\/revisions"}],"predecessor-version":[{"id":20346,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/3522\/revisions\/20346"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/3429"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3522"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}