From 859cf8bf363f615eaa67f8a7c24be235d846a685 Mon Sep 17 00:00:00 2001 From: nick Date: Fri, 4 May 2018 10:38:09 +0800 Subject: [PATCH] update --- crontab.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/crontab.md b/crontab.md index dfcc9ec..37c86f0 100644 --- a/crontab.md +++ b/crontab.md @@ -70,4 +70,20 @@ run-parts 参数指定的目录必须是以下任意一个,其他位置的目 - /etc/cron.hourly 小时 - /etc/cron.daily 每天 - /etc/cron.weekly 每周 -- /etc/cron.monthly 每月 \ No newline at end of file +- /etc/cron.monthly 每月 + +日志 + +CentOs7.2 crontab 日志路径为 `/var/log/cron` + +Ubuntu16.04 crontab 日志路径为 `/var/log/cron.log` + +Ubuntu16.04 默认不生成 crontab 日志,需要更改配置,方法如下 + +``` +sudo vim /etc/rsyslog.d/50-default.conf + +cron.* /var/log/cron.log #将cron前面的 # 注释符去掉 + +sudo service rsyslog restart +``` \ No newline at end of file