로그를 날짜 별로 생성 또는 압축해서 관리 할수 있도록
별도의 파일을 하나 만들어서 아래 내용을 붙여넣기 하신 다음에 crontab 에다
등록하시며 편리하게 로그를 관리 할 수 있을 겁니다.
#Bill Pennington 1/19/2000
#Set the date variable
date=`date +%m-%d-%Y`
#Rename the messages file
mv /var/log/messages /var/log/messages.$date
#HUP the syslog daemon so it writes to a new file
killall -HUP syslogd
#Compress the file
#!/bin/bash
#Simple script to rotate the log files on a daily basis
#Bill Pennington 1/19/2000
#Set the date variable
date=`date +%m-%d-%Y`
#Rename the messages file
mv /var/log/messages /var/log/messages.$date
#HUP the syslog daemon so it writes to a new file
killall -HUP syslogd
#Compress the file
#!/bin/bash
#Simple script to rotate the log files on a daily basis
#Bill Pennington 1/19/2000
#Set the date variable
date=`date +%m-%d-%Y`
#Rename the messages file
mv /var/log/messages /var/log/messages.$date
#HUP the syslog daemon so it writes to a new file
killall -HUP syslogd
#Compress the file
/bin/gzip /var/log/messages.$date
#Rename the secure file
mv /var/log/secure /var/log/secure.$date
#HUP the syslog daemon so it writes to a new file
killall -HUP syslogd
#Compress the file
/bin/gzip /var/log/secure.$date
server
bibaram2005.02.18 · 2분 읽기 · 조회 3,925
로그 날짜 별로 생성하기
bibaram2005.02.18 · 2분 읽기 · 조회 3,925이어서 읽기
html↗
favicon.ico Status 404 해결방법
favicon.ico 파일이 있어서 경로를 직접 설정해주는 게 최선이지만favicon.ico가 없다면 아래와 같이 넣어준다. <html> <head> <link rel="shortcut icon" href="data:image/x-icon;," type="image/x-icon"> </head…
2020.09.25·1분 읽기
php↗
Codeigniter api에서 어떤 곳에서 보낸 json
$aData = var_export(file_get_contents('php://input'),TRUE); $aArr = json_decode(str_replace("'", "", $aData), true); 버전에 따라 다를 수도 있음 $this->input->raw_input_stream 이렇게 해보면 됨
2020.09.11·1분 읽기
server↗
apache 이미지 로그 안쌓이게 하기
웹서버를 운영하다 보면 Apache log 가 엄청나게 많이 쌓인다. logrotate 가 실행되고 있다면 어느 정도 로그가 정리가 되겠지만 아니라면 로그가 쌓여서 서버가 엄청 느려지거나 서버가 다운될 수도 있다. ErrorLo…
2020.02.17·2분 읽기
댓글 0
아직 댓글이 없습니다.