Cron Problems

Status
Not open for further replies.

laeresh

New Member
Messages
38
Reaction score
0
Points
0
My cronjob doesnt seem to work,

i want to run it every 15 minutes, but it never works

the command is

php home/shys/public_html/koc/cron.php

does anyone know the problem ?

or does anyone know the correct command if thats whats wrong, cuz i need it real bad.


Grz: Shys;)
 

mitamata

New Member
Messages
81
Reaction score
0
Points
0
First thing that comes to mind is a permissions problem. You need to set the permissions on the file to allow 'world' to execute the file.
If that's not it, then it must me something else. Have you tried running the script with the browser to see if it actually works?
Without much info, it's hard to say what's wrong.

At the moment, the emails are not being sent when a cron job runs (btw, someone should look into that), so don't rely on the emails to check if the script actually ran.
 

retep992

New Member
Messages
4
Reaction score
0
Points
0
im trying to do the same thing. my unix cron command looks like this:

Code:
*/10 * * * * /home/itzalive/public_html/php/checksendmail.php

I have followed your instructions and gave the file full privilages but it still doesn't run

it runs fine in the browser - it goes through a database and deletes each row it processes. but i leave it for an hour - even though its only 10mins cron - and it does nothing
 
Last edited:

mitamata

New Member
Messages
81
Reaction score
0
Points
0
I don't know how it is on other servers, but I'm on Stoli and the email output of the cron jobs doesn't send at the moment, though the cron jobs still run. Neither do any other emails I try to send, though the mail() function returns true as if the mail got sent. Don't know if that's just me or the whole server, but that's how it is.
Without the email output (which sends you any errors with the script) or some test mails that you could send from within the script, I don't know how to attempt to debug.

If you're on a server that's having issues at the moment, I'd suggest holding off on this until things are more stable.
The only thing I can think of at the moment is: do you have "#!/usr/bin/php" (without the quotes) at the begining of your php script? I think that has to be there.

I'm really no expert on this, I've managed to crash a server at work with a cron job xD But that wasn't entirely my fault :shifty:
 

laeresh

New Member
Messages
38
Reaction score
0
Points
0
so i put in #!/usr/bin/php home/shys/public_html/koc/cron.php as command ?

i hope this will work ;)..
Edit:
But it doesnt work im afraid :(, how come it just doenst works !!!
 
Last edited:

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Use php-cron, not php.

So it'll look like `php-cron /home/shys/public_html/koc/cron.php`
 
Last edited:

mitamata

New Member
Messages
81
Reaction score
0
Points
0
so i put in #!/usr/bin/php home/shys/public_html/koc/cron.php as command ?

No, I meant put it in the file. So the start of your script would look like this for example:

Code:
#!/usr/bin/php
 
<?
$new_variable = "I'm just an example";
 
[...your script body here...]
 
?>

Don't know if that will make a difference or not, I'm new at this as well.

And btw, Brandon, I had the cron jobs set up without the "php-cron" at the begining and they ran just the same ;)
 

laeresh

New Member
Messages
38
Reaction score
0
Points
0
noo......


i need to know what command i need to run in for the cronjobs,

if i put that in the script i still need something to activate that script WICH is the cronjob

the location of my file that needs to be cronned is in
/public_html/koc/cron.php

so what command do i run for that !,
 

Brandon

Former Senior Account Rep
Community Support
Messages
19,181
Reaction score
28
Points
48
Use what I posted above.
 
Status
Not open for further replies.
Top