浏览代码

Confiured for log rotation using logrotate

Alois Mahdal 12 年前
父节点
当前提交
c5f065fc38
共有 2 个文件被更改,包括 8 次插入1 次删除
  1. 1
    1
      cgi-bin/htlog/htlog.cgi
  2. 7
    0
      etc/logrotate.d/htlogr

+ 1
- 1
cgi-bin/htlog/htlog.cgi 查看文件

18
 
18
 
19
 use CGI;
19
 use CGI;
20
 
20
 
21
-my $LOG_FILE = 'htlog.log';
21
+my $LOG_FILE = '/var/log/htlogr.log';
22
 open my $fh, ">>", $LOG_FILE or die "cannot open log file for appending: $!";
22
 open my $fh, ">>", $LOG_FILE or die "cannot open log file for appending: $!";
23
 
23
 
24
 sub stamp {
24
 sub stamp {

+ 7
- 0
etc/logrotate.d/htlogr 查看文件

1
+/var/log/htlogr.log {
2
+    weekly
3
+    rotate 8
4
+    compress
5
+    delaycompress
6
+    create 640 www-data adm
7
+}