1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Cron Job Email Address

Discussion in 'Plesk for Linux - 8.x and Older' started by Superman859, Sep 19, 2008.

  1. Superman859

    Superman859 Guest

    I have a few cron jobs that run very often, and I am not interested in receiving emails regarding them every time they run (I just realized I had 500,000 emails taking up 2gb space because of this at one address). However, I noticed that under preferences, email address for cron messages is required.

    I read that if I am manually configuration the crontab file, I should be able to run a command as

    env php -q /var/www/vhosts/site.com/subdomains/marketing/httpdocs/admin/cron/cron.php >> /var/www/vhosts/site.com/subdomains/marketing/httpdocs/admin/cron/cron.log

    and this should simply pipe the output to a log file. This seems like it would be a better solution (an even better solution would not provide any output unless it failed. The job runs every minute, so that's either a lot of emails or a large log file. I'm only interested if it fails).

    I tried setting up the cron job using plesk control panel and in the command field I simply used the line above. However, it doesn't appear to be working correctly. The log file remains empty, and the emails have stopped. I tried running

    /etc/init.d/crond restart

    as well, without any success.

    Does anyone know a good solution for this situation, or at least what I may be doing wrong with trying to get it to go to a log file rather than email? I'm not sure how setting up the command as above in the control panel works or how the email address under preferences works (other than it is marked as required field). Is there a way to set this up appropriately using just the control panel, or will I need to manually edit the crontab file and not set it up in the control panel at all? I use the control panel for pretty much everything, so I'd like to stick with it if possible.

    EDIT: The task is currently scheduled under the domain in the control panel. I did not configure it from the main 'server' scheduled tasks button.