Good afternoon everyone
Sorry for my English I only speak Spanish
I have observed in my panel that the emails with the outputs of a cron task are not sent by email
I look in the logs and I can't find a reason
I test the panel with a mail for general users and I see that the mail() function works correctly.
Some help to be able to see what happens with the emails of the scheduled jobs
Thank you
Cron jobs not sending mail [SOLVED]
Re: Cron jobs not sending mail
Hello,
do you send the emails within your script yourself or do you rely on the Cron daemon to send the emails, when there is any output of the script (btw. it does not use the mail() function)?
If later, please provide the way, how you setup the scheduled task notification settings and read the help text:
do you send the emails within your script yourself or do you rely on the Cron daemon to send the emails, when there is any output of the script (btw. it does not use the mail() function)?
If later, please provide the way, how you setup the scheduled task notification settings and read the help text:
KeyHelp wrote:On Error
The notification contains the error output of the command (= standard error stream, STDERR). If the output is empty, no notification is sent.
Make sure your script writes into the correct output stream to let the cron deamon catch the error and send the mail.KeyHelp wrote:Always
The notification contains the output of the command (= standard output stream, STDOUT). If the output is empty, no notification is sent
Mit freundlichen Grüßen / Best regards
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Re: Cron jobs not sending mail
Good afternoon
Forgive my English .. if there is something badly expressed
If I understand what you are saying about sending cron without output.
and always send the errors to the mail without problem
On this occasion, to control a document number, the cron was told to send by mail everything that had output
I indicate the cron by ssh put in the panel
# Cron Documents
MAILTO="mymail@gmail.com"
20 9 * * * php /home/users/development/www/myweb/artisan tracking:email
This task generates an output... which is visible by the control panel when run manually
But it is never sent by mail .. it only sends an error
Thanks for everything
-----------------------------------
Estado: Finalizado
Tiempo de ejecución: 00:00:00
Código de estado de devolución: 0 (Éxito)
Salida:
Cantidad de documentos: 3
Documentos .. {33.33%} | 1 de 3
Documentos .. {66.67%} | 2 de 3
Documentos .. {100%} | 3 de 3
Forgive my English .. if there is something badly expressed
If I understand what you are saying about sending cron without output.
and always send the errors to the mail without problem
On this occasion, to control a document number, the cron was told to send by mail everything that had output
I indicate the cron by ssh put in the panel
# Cron Documents
MAILTO="mymail@gmail.com"
20 9 * * * php /home/users/development/www/myweb/artisan tracking:email
This task generates an output... which is visible by the control panel when run manually
But it is never sent by mail .. it only sends an error
Thanks for everything
-----------------------------------
Estado: Finalizado
Tiempo de ejecución: 00:00:00
Código de estado de devolución: 0 (Éxito)
Salida:
Cantidad de documentos: 3
Documentos .. {33.33%} | 1 de 3
Documentos .. {66.67%} | 2 de 3
Documentos .. {100%} | 3 de 3
Re: Cron jobs not sending mail
To help you, you can use https://www.deepl.com/translator for translating - it produces high quality translations
.
Can you provide a screenshot of the cronjobs / scheduled tasks within the KeyHelp user interface - just to let me check if everything is setup correctly.
(Attention - you may want to anonymize your email address)

Can you provide a screenshot of the cronjobs / scheduled tasks within the KeyHelp user interface - just to let me check if everything is setup correctly.
(Attention - you may want to anonymize your email address)
Is this the output of this the following command? If not, please provide the output of this command. Replace <USERNAME> with the appropriate username.# Cron Documents
MAILTO="mymail@gmail.com"
20 9 * * * php /home/users/development/www/myweb/artisan tracking:email
Code: Select all
crontab -u <USERNAME> -e
Mit freundlichen Grüßen / Best regards
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Re: Cron jobs not sending mail
Thanks for the recommendation for the translator
Correct, the output I have set is crontab -u desarrollo -e,
I attach the image of keyhelp
Thanks
Correct, the output I have set is crontab -u desarrollo -e,
I attach the image of keyhelp
Thanks
Re: Cron jobs not sending mail
It seems, that the output of the called script does not write to the STDOUT stream (standard output), and therefor may not be captured by the Cron-Daemon. What software do you use?
Some ideas to further investigate:
- Run this command (artisian seguimiento:email) on the CLI itself and see, how it behaves, make sure there are no interactive messages by the script etc.
- Check the code of the script and how it outputs the data
- Create a wrapper script, where you catch the output of your script and call this wrapper script as cronjob, instead of "artisian seguimiento:email"
- Redirect the STDERR to STDOUT by adding "2>&1" to the end of the command e.g. "... artisian seguimiento:email 2>&1"
- Check if the Cron-Daemon would send an emails when just calling a simple test script e.g. " <?php echo 'Test'; "
Some ideas to further investigate:
- Run this command (artisian seguimiento:email) on the CLI itself and see, how it behaves, make sure there are no interactive messages by the script etc.
- Check the code of the script and how it outputs the data
- Create a wrapper script, where you catch the output of your script and call this wrapper script as cronjob, instead of "artisian seguimiento:email"
- Redirect the STDERR to STDOUT by adding "2>&1" to the end of the command e.g. "... artisian seguimiento:email 2>&1"
- Check if the Cron-Daemon would send an emails when just calling a simple test script e.g. " <?php echo 'Test'; "
Mit freundlichen Grüßen / Best regards
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Alexander Mahr
**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Re: Cron jobs not sending mail [SOLVED]
Good afternoon
Sorry for the delay ... work has been hard during this time and I could not look at your instructions.
- after following your instructions it was not responding
- I tried on another server and it worked without problems ...
I restarted the server and create the processes again and everything has worked correctly the error outputs, as the correct outputs.
Thank you very much for everything
Sorry for the delay ... work has been hard during this time and I could not look at your instructions.
- after following your instructions it was not responding
- I tried on another server and it worked without problems ...
I restarted the server and create the processes again and everything has worked correctly the error outputs, as the correct outputs.
Thank you very much for everything