Perl 中的 Carp 库在哪里,当 运行 从 crontab 打印日志

Where does, Carp library in Perl, print logs when run from crontab

我有一个使用 Carp(鲤鱼鸣叫)打印信息和错误的 Perl 脚本。 当直接 运行 时,我可以在控制台上看到输出。但是当我 运行 将脚本作为 cronjob 时,我不知道消息的去向。

已签入 /var/log/messages /var/log/cron。未找到

请帮忙。

我认为你应该在你的 cronjob 中重定向标准输出。

man cron:

When executing commands, any output is mailed to the owner of the crontab (or to the user named in the MAILTO environment variable in the crontab, if such exists). Job output can also be sent to syslog by using the -s option.