老是提示有邮件,什么情况啊
Tofloor
poster avatar
呆了个呆
deepin
2014-11-02 18:15
Author
您在 /var/mail/root 中有邮件
邮件内容如下:

/etc/cron.daily/logrotate:
error: stat of /var/log/deepin.log failed: No such file or directory
run-parts: /etc/cron.daily/logrotate exited with return code 1
Reply Favorite View the author
All Replies
Feng Yu
deepin
2014-11-02 19:24
#1
logrotate是大多数linux发行版默认带的自动滚动日志的工具。

这个报错说/var/log/deepin.log这个文件不存在,我找了下是在/etc/logrotate.d/deepin-logger这个文件存放的,编辑这个文件,加上missingok即可。如sudo gedit /etc/logrotate.d/deepin-logger打开编辑这个文件,修改为以下内容:
  1. /var/log/deepin.log {
  2.        daily
  3.        missingok
  4.        rotate 7
  5.        nocompress
  6.        create 0644 deepin-daemon deepin-daemon
  7. }
Copy the Code
Reply View the author
呆了个呆
deepin
2014-11-03 00:55
#2
logrotate是大多数linux发行版默认带的自动滚动日志的工具。

这个自滚动日志工具能简单讲解一下么,网上的都看得不明不白,主要是没同步示例。

我现在服务器是 CentOS 的,有 apache, squid 等等的日志想要按日和周等分割,但是不会用
Reply View the author
Feng Yu
deepin
2014-11-04 07:23
#3
[quote]logrotate是大多数linux发行版默认带的自动滚动日志的工具。

这个自滚动日志工具能简单讲解一下么,网上的都看得不明不白,主要是没同步示例。

我现在服务器是 CentOS 的,有 apache, squid 等等的日志想要按日和周等分割,但是不会用[/quote]
如果你是软件仓库安装,不用管,软件包自带有logrotate脚本,如果是自己编译安装的,才需要自己写规则。也不难,man logrotate看一下解释就行了,google一下还有一些范例,再不济觉得麻烦随便找一个差不多的logrotate脚本抄一下,改改就行了,很容易理解配置作用。基本都在/etc/logrotate.d目录下
Reply View the author
呆了个呆
deepin
2014-11-04 18:06
#4
[quote][quote]logrotate是大多数linux发行版默认带的自动滚动日志的工具。

这个自滚动日志工具能简单讲解一下么,网上的都看得不明不白,主要是没同步示例。

我现在服务器是 CentOS 的,有 apache, squid 等等的日志想要按日和周等分割,但是不会用[/quote]
如果你是软件仓库安装,不用管,软件包自带有logrotate脚本,如果是自己编译安装的,才需要自己写规则。也不难,man logrotate看一下解释就行了,google一下还有一些范例,再不济觉得麻烦随便找一个差不多的logrotate脚本抄一下,改改就行了,很容易理解配置作用。基本都在/etc/logrotate.d目录下[/quote]

主要是不知道具体指令的含意,哎,我自己找找看吧
Reply View the author