delayed crontab

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
flamedog
New to forums
New to forums
Posts: 13
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Wed May 09, 2012 4:08 pm

delayed crontab

Post by flamedog »

after sending a ticket to support they sent me here so here is my problem.

ok so i set this up the other day and its delayed the times :| by at least 2-4hours... heres my crontab
"
#8:30am
30 08 * * * php /usr/www/flamedog1/mail1.php
#
#10:30am
30 10 * * * php /usr/www/flamedog1/mail2.php
#
#08:30pm
30 20 * * * php /usr/www/flamedog1/mail3.php
#
#10:30pm
30 22 * * * php /usr/www/flamedog1/mail4.php
"
ive tested each script from the ssh console and they worked with no delay. and ive left them outside the "public" folder so that people via the website can not trigger the mail scripts. am i doing something wrong ? or is it crontab's fault ?

here is what the mail script files look like.

<?php
$to = 'email@fake.com;
$subject = 'This is a subject line';
$message = ''msg";
$headers = 'From: info@mywebsiteaddress.com'; <- because when i send it from the server it sends as "flamedog1@hosted10.nfoservers.com"

mail($to, $subject, $message, $headers);
?>
User avatar
Edge100x
Founder
Founder
Posts: 13120
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: delayed crontab

Post by Edge100x »

I checked the logs and your cronjob is being executed correctly at the appropriate times:

Code: Select all

# grep "flamedog" /var/log/messages | grep CMD
Aug 28 08:30:01 hosted10 cron[23213]: (flamedog1) CMD (php /usr/www/flamedog1/mail1.php )
Aug 28 10:30:01 hosted10 cron[10048]: (flamedog1) CMD (php /usr/www/flamedog1/mail2.php)
Aug 28 20:30:01 hosted10 cron[32326]: (flamedog1) CMD (php /usr/www/flamedog1/mail3.php)
Aug 28 22:30:01 hosted10 cron[16751]: (flamedog1) CMD (php /usr/www/flamedog1/mail4.php)
It could be that your email provider delayed the email delivery.
flamedog
New to forums
New to forums
Posts: 13
Joined: Wed May 09, 2012 4:08 pm

Re: delayed crontab

Post by flamedog »

weird because when ever i do it manully it sends fine but when its auto sent its delayed X3 ill have to look in to some why to fix this :3 thanks for your help once again ^^
Post Reply