Cron Jobs - need help as a user of DA

Almin

Verified User
Joined
Apr 22, 2005
Messages
6
Hello!

I need help with cron jobs for one script. This is first time I try to setup cron jobs and I don't know where I make mistakes.
The instruction that comes with the script tells me to set up cron jobs like this:

0 0 * * * php -q /path/to/script1.php
*/15 * * * * php -q /path/to/script2.php

I did so in Direct Admin but it doesn't work. In Direct Admin I write in the "command" field :

php -q /home/myusername/domains/mydomain.com/public_html/subfolder/script1.php

I must do something wrong because cron jobs does not work at all.
Can someone give me a good explanation of cron jobs setup in DirectAdmin and help me with this please ?

Thanks

Almin
 
Test script

Could you prowide some test script please, I am not coder and cannot write it ?
 
I tried to set up cron jobs via ssh

...and I defined following cron jobs:

[email protected]
0 0 * * * php -q /home/almin/domains/clicktreasure.com/public_html/aedating33/periodic/cmd.php
*/10 * * * * php -q /home/almin/domains/clicktreasure.com/public_html/aedating33/periodic/notifies.php


After 10 minutes I got email from Cron Daemon:

php : not found


How shell I write cron commands so that php is found ? ( And what "-q" means ?
 
php is likely at /usr/local/bin/php. Use that full path in the command.

The -q option means "quiet" and tells php to not print headers.
 
You'll need to specify the absolute path to the php binary. which php or whereis php will help you there. (execute those via ssh)

Check the php website for the options. I don't quite remember, but I have a feeling -f is to force it and -q is to parse the file like a normal php script overiding php's detection methods.
 
Thank you

I followed your instructions and everything is working now.
I will remember you when I get rich :)))
 
Actually that account is a cover, I really have little green people who take care of all my money scattered throughout the planets. Sometimes they get a little board and leave traces for us to spend more money on an endless search to find them.
Of course all government expenses and private funding goes into my account. :p
 
Back
Top