dmh

*
  • *
  • 5
Remove Cronjob-Resuming-Message
« on: March 28, 2011, 09:30:18 AM »
Hello,
i´m running a daily cronjob for generating our sitemap. The output of the cronjob is following:

Code: [Select]
Resuming the last session (last updated: 1970-01-01 00:00:00)
1 | 167 | 95.6 | 0:00:16 | 0:45:14 | 1 | 1,333.1 Kb | 1 | 0 | 1333
20 | 148 | 1,425.2 | 0:00:36 | 0:04:32 | 1 | 1,729.8 Kb | 20 | 819 | 1729
40 | 128 | 2,503.7 | 0:01:01 | 0:03:17 | 1 | 1,948.7 Kb | 39 | 985 | 1948
60 | 108 | 3,626.8 | 0:01:19 | 0:02:23 | 1 | 1,914.8 Kb | 59 | 1015 | 1914
..... continues for a lot more rows ......
<br />Done, redirecting to sitemap view page.
<script>
top.location = 'index.php?op=view'
</script>

The sitemap is generated successfully. Unfortunately our server is configured, that always, when the cronjob-script outputs text, i get a notification email. Because of the output i receive this emails every day.

My question is: Is it possible to disable this status-messages for the cronjob-file and limit the output to error messages?

Best regards,
Otto
Re: Remove Cronjob-Resuming-Message
« Reply #1 on: March 28, 2011, 11:37:57 AM »
Hello,

please try to change the command line used for cron job from:
/usr/bin/php /path/to/generator/runcrawl.php
to:
/usr/bin/php /path/to/generator/runcrawl.php >/dev/null

dmh

*
  • *
  • 5
Re: Remove Cronjob-Resuming-Message
« Reply #2 on: March 28, 2011, 11:57:54 AM »
If i´m understanding ">/dev/null" right, then all output-messages are thrown away? Any possibility to force error-messages to be shown?

I will try your example. I anyway can verify if the sitemap.xml was generated successfully via filedate and -size.

Thank you for your hint.

Best regards,
Otto
Re: Remove Cronjob-Resuming-Message
« Reply #3 on: March 29, 2011, 09:36:26 PM »
That will redirect all standard output of the script. If there is a problem running the script, it's sent to error output stream, and normally should be emailed.

dmh

*
  • *
  • 5
Re: Remove Cronjob-Resuming-Message
« Reply #4 on: March 30, 2011, 03:12:19 PM »
Thank you very much. Working like a charme :)

Best regards,
Otto