¸ÅÀÏ ¸ÅÀÏ ·Î±× ÀÚ¸£´Â ¹æ¹ý |
±Û ¾´ ÀÌ |
linux |
³¯ Â¥ |
2003³â 03¿ù 08ÀÏ 17½Ã 52ºÐ 42ÃÊ |
º» ¹® |
¸ÅÀÏ ¸ÅÀÏ ·Î±× ÀÚ¸£´Â ¹æ¹ý :
rotate.sh
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#!/bin/bash
DATE=`/bin/date +%y%m%d`
/bin/cp /home1/apache/logs/access /home1/apache/logs/access.$DATE
cat /dev/null > /home1/apache/logs/access
/bin/gzip /home1/apache/logs/access.$DATE
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 0 * * * /home1/apache/bin/rotate.sh
ÀÌ°É ¸ÅÀÏ °°Àº ½Ã°£¿¡ crontab ¿¡ ³Ö¾î¼ µ¹¸®¸é
-rw-r--r-- 1 irteam irteam 212735489 1¿ù 28 22:08 access
-rw-r--r-- 1 irteam irteam 27805579 1¿ù 24 00:01 access.020124.gz
-rw-r--r-- 1 irteam irteam 29077252 1¿ù 25 00:01 access.020125.gz
-rw-r--r-- 1 irteam irteam 28892112 1¿ù 26 00:01 access.020126.gz
-rw-r--r-- 1 irteam irteam 26792372 1¿ù 27 00:01 access.020127.gz
-rw-r--r-- 1 irteam irteam 24415180 1¿ù 28 00:01 access.020128.gz |
|
|
|