When I use the following command in a shell:
...the command does the job! It outputs "Removed X", which is what I expect. However, when I use it in a crontab, like this:
...it sends me an e-mail with the same output every hour, as if the actual deletion isn't taking place. The Python code I've written does nothing special, so I don't understand why it works when done "manually" but not when executed in a cron job. Any ideas? asked 13 Sep '12, 11:25 damd
showing 5 of 6
show 1 more comments
|
Try redirecting the output to a log to see if it captures any error messages. You can add: 2>&1 >> /home/myuser/cron.log to the end of your command for example.
@bmeyer71: But doesn't the MAILTO directive do just that? Because as I said, I do get e-mails, but maybe that's only stdout?
@damd: Yes it should send that information. However, you might still want to give the redirect a try to see if it provides anything different.
I just tried that now, with the cron job running once every minute. It only outputs "Removing X" once and then stopped. Now what? :)
Maybe open a support ticket for us to take a closer look.
Thanks, I'll do that when it happens again. (It's really difficult to reproduce it "manually", so to speak.)