• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question How do insert line breaks from a PHP script into the Plesk cron job logs?

teha

New Pleskian
Hello,

I am running the recent version of Plesk (Plesk is updating automatically).

I have a PHP script on my server which is run by a Plesk cron job every 6 hours and I set that I would like to receive the (error) log from the cron job by e-mail.

When the cron job is running, the PHP script generates output in this way:
PHP:
echo("Step 1\r\n");
//...
echo("Step 1 finished \r\n");

However, when the script completes, I get an e-mail with output like
Step 1\r\nStep 1 finished\r\n
and so on.

Doing the same with "<br />" instead of "\r\n" does not help either.

Does anyone of you know of a similar situation or how I can get an e-mail output like
Step 1
Step 1 finished
?

Looking forward for your answers.

Best regards,
teha
 
Last edited:
Back
Top