I'm on an AWS server. I wrote a crontab and placed it on the server under /etc/cron.d
. The contents of the crontab are the following:
SHELL=/bin/bash
PATH=/sbin:/bin:usr/sbin:/usr/bin
MAILTO=root
HOME=/
*/5 * * * * root <full-path-to-write-command> >> <full-path-to-txt-output-file>
After running sudo service crond restart
, I check the logs by doing sudo tail -f /var/log/cron
.
I can observe the cronjob in the logs:
<date-time-stamp> ip-<ip-address> CROND[12930]: (root) CMD (<full-path-to-write-command> >> <full-path-to-txt-output-file>)
However, when I check the <full-path-to-txt-output-file>
, I don't see file being written to.
What could be the problem, if I see that the cronjob is executing? Thanks