I have a cron job for which I want to log output. The cron file (crontab -e
) is:
0 7 * * * node $HOME/server/task.js >> $HOME/server/log.txt
The cron task is called:
$ grep CRON /var/log/syslog
Nov 4 07:00:01 ip-... CRON[0000]: (bitnami) CMD (node $HOME/server/task.js >> $HOME/server/task.txt)
Nov 4 07:00:01 ip-... CRON[0000]: (CRON) info (No MTA installed, discarding output)
The line with the error means that I no email installed, but nor do I want to.
The output file is empty when the first line of the NodeJS task uses console.log()
.
I confirm that the cron job does not run.
How can I debug what is wrong, get cron to run, and save the result to a file?