Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
Apacheã®ãã°ã¯ã»ã£ã¨ãã¨ãµã¤ãºãè¨å¼µããä¸æ¹ãªã®ã§ï¼ é©å½ãªã¿ã¤ãã³ã°ã§å¥ã®ãã¡ã¤ã«ã«åãæ¿ããã®ããããï¼ ãã¡ã®Linux(Red Hat 7.1J)ã§ã¯ï¼ã·ã¹ãã æ¨æºã§cronã«ãã£ã¦logrotateãå®æçã«åãããã«ãªã£ã¦ããã®ã§ï¼ ããã¤ã§ä¸ç·ã«ãã£ã¦ããããã¨ã«ãã¾ãï¼ logrotateã¯ï¼ç¹ã«è¨å®ããªããã° access_log.1 access_log.2 ã»ã»ã» ã¨ããå ·åã§ï¼ãã¨ã§å°ã£ã¦ãã¾ããããªãã¡ã¤ã«åãã¤ãã¦ãã¾ãããï¼å°ã工夫ãè¡ã£ã¦ï¼ access_log.20030419 access_log.20030426 ã»ã»ã» ã¨ãã風ã«ãªãããã«ãã¦ãã¾ãï¼(1é±éã«1åãã¼ãã¤ãããã¾ãï¼ããããweeklyã§ããª) â /usr/local/apache2/logs/access_log { weekly copytruncate postrot
ãã°ãã¡ã¤ã«ã®è¦ªãã£ã¬ã¯ããªão+wãã°ã«ã¼ããroot以å¤ã§g+wã§ããå ´åã¯ããã¼ããã¦ãããªãããã ãããªæãã®è¨å®ã§ /var/log/logtest/logtest.log { copytruncate size 1 rotate 5 }# ls -ld /var/log/logtest drwxrwxr-x 2 john john 24 Jan 8 22:19 /var/log/logtest # ls -l /var/log/logtest total 0 -rw-r--r-- 1 john john 0 Jan 8 22:18 logtest.logã¨ãã¦ããã¨johnã°ã«ã¼ããæ¸ãè¾¼ã¿å¯è½ãªã®ã§ããã¼ããã¹ãããããã # cat /var/log/logtest/logtest.log hello # logrotate /etc/logrotate.d/logtes
logrotate ã¯ãæ¾ã£ã¦ããã°ééãªãè¥å¤§ãã¦ãã¾ãå種ãã°ãã¡ã¤ã«ã«å¯¾ãã¦ãä¸ä»£ãã¼ãã¼ã·ã§ã³ããã¦ä½ä»£ç®ãã«ãªã£ããç ´æ£ããã¨ããããããã¡ã¼ã«ã§ã©ããã«éä¿¡ãããªã©ãæ§ã ãªå¦çãè¡ãããä¸ä»£ç®¡çããµã¤ãºå¶éãªã©ã®æ©æ§ãèªåã§æããªãããã°ã©ã ããã®ãã°ã管çããã®ã«ãªãã¦ã¯ãªããªãéå ·ã ã Logrotateå®è¡ã®æµã logrotate èªä½ã¯ãã¼ã¢ã³ã§ã¯ãªãã®ã§ cron (â»1) ã¨çµã¿åããã¦å©ç¨ãããå®è¡ã®æµãã¯ãRedHatç³»ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã§ã¯ä»¥ä¸ã®ããã«ãªã£ã¦ããï¼ cron ã run-parts ã³ãã³ã(â»2)㧠/etc/cron.daily/logrotate ã¹ã¯ãªãããããã¯ããã /etc/cron.daily/logrotate 㯠主è¨å®ãã¡ã¤ã«ã§ãã /etc/logrotate.conf ããè¨å®ãèªã¿è¾¼ã㧠logrotate ã
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}