Answer the question
In order to leave comments, you need to log in
How to output the result of a job in cron to a file with a runtime stamp?
Good afternoon!
There is a job in cron that executes the command to restart the named service every day at 5 am (why it is not important), and actually output the result of this command to a file like /var/log/named_restart.log.
But if you open this file and look at the entries, they will all be the same:
Stopping named.
Waiting for PIDS: 86988.
Starting named.
Stopping named.
Waiting for PIDS: 98754.
Starting named.
Answer the question
In order to leave comments, you need to log in
So add to Cron, before the restart command, a time entry. The log, as I understand it, is written directly from cron?
Use syslog.
/etc/syslog.d/named_restart.conf:local0.* /var/log/named_restart.log
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question