cron jobs

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
tiger
New php-forum User
New php-forum User
Posts: 16
Joined: Thu Jun 23, 2011 9:28 pm

Sat Oct 26, 2013 8:52 pm

Hello guys

I have some problems with the cron jobs. I used these two lines in my (cron.txt) file:

Code: Select all

MAILTO=myemail@gmail.com
1 0 * * * * php -f /home/my_user_name/public_html/cron.php
(note: I got this syntax from the web host)
"php -f /home/user_name/public_html/cron.php"


and in my (cron.php) file:

Code: Select all

<?php
$to= "myemail@gmail.com";
$subject = "Cron Job Status";
$from = "myemail@gmail.com";
$message = "The cron job is working fine."; 
mail($to,$subject,$from, $message); 
?>
and that cron.php file is working fine when I run in via the URL.

but it's not working although the permissions for both files are rwxr-xr-x

I also used the cron jobs function from the web host service, but still did not work..

any suggestion?

johnj
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Mon Oct 28, 2013 12:21 am

not working from where...???

schedule another cron job (as a test) and see if it works. If it works, compare these two and figure out what you are doing wrong.

tiger
New php-forum User
New php-forum User
Posts: 16
Joined: Thu Jun 23, 2011 9:28 pm

Mon Oct 28, 2013 12:30 am

the cron.txt does not execute. I asked the webhost and they said they support it, however, when I used the cron jobs from the webhost C-Panal, it still does not work. I told them that, but they still say it's working.

The cron.php file works just fine, and I get email when I go the url of cron.php

So my concern is that is there anything wrong with my cron.txt command OR it is that the webhost actually does not support it?

Post Reply
  • Information
  • Who is online

    Users browsing this forum: Bing [Bot] and 3 guests