linux – Crontab:有开始和结束时间的日志吗?

我的 linux服务器上有很多crontask用于我们的应用程序.但我没有找到任何方法知道任务何时结束,以及它运行了多长时间.
我必须添加一个类似软时间的命令来记录这个吗?有没有办法配置cron来做到这一点?
我在/etc/cron.daily中有一个脚本需要花费太多时间,但我无法确定哪一个

问候,
塞德里克

解决方法

男子cron

你应该看到类似的东西

-L loglevel
               Sets the loglevel for cron. The standard logging level (1) will
               log  the start of all the cron jobs. A higher loglevel (2) will
               cause cron to log also the end of all cronjobs,which  can  be
               useful  to  audit  the  behavIoUr of tasks run by cron. Logging
               will be disabled if the loglevel is set to zero (0).

要使用该选项,您可以查看/ etc / default / cron

至少在Debian中它有这样的评论

# Extra options for cron,see cron(8)
# For example,set a higher log level to audit cron's work
# EXTRA_OPTS="-L 2"

在更改配置文件后,您需要重新启动Cron:

/etc/init.d/cron restart

相关文章

1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...
1 删除0字节文件 find -type f -size 0 -exec rm -rf {} ...
## 步骤 1:安装必要的软件包 首先,需要确保系统已安装 `dh...