PDA

View Full Version : CRON Error retrieval



j-a-c-k
December 13th, 2016, 10:06 PM
I am new to Ubuntu and confused.
I want to setup a simple cron job and I see that I am getting errors but I may not see the content of the error because I have no mail transport installed?
Surely there is no requirement that I setup a mail server and a mail client so that I can see why my cron job is failing?
Is there no way to simply redirect the error to a place where I can read the error message?

Jack

steeldriver
December 13th, 2016, 10:20 PM
Have you tried simply redirecting the command(s) standard output and/or standard error to a file?



* * * * * /path/to/some/command >> /path/to/some/logfile 2>&1

deepakdeshp
December 13th, 2016, 10:20 PM
Hello, This should help you. . https://ubuntuforums.org/showthread.php?t=2346322

j-a-c-k
December 13th, 2016, 10:51 PM
Yes, I have tried this,
* * * * * /path/to/some/command >> /path/to/some/logfile 2>&1

The problem is fixed.
The php page that I was trying to execute now executes and updates the database.

THANK YOU

ajgreeny
December 13th, 2016, 11:25 PM
Great! Please mark as SOLVED from the Thread Tools menu up-top if this is now solved to your satisfaction. It is a great help to users searching the forum.