Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: utti on March 21, 2007, 08:36:36 AM
-
Hi everybody !
I have problem with running php script in cron. I've searched and read everything about my problem ... and nothing helps. My problem began in January 17. after sme-update/upgrade ...
Running that script is very important because my cms-systems e-mail notify does not work anymore :-(
I've tested:
*/10 * * * * root /usr/bin/php http://test.testbox.test/cron.php > /dev/null
*/10 * * * * /usr/bin/php http://test.testbox.test/cron.php > /dev/null
*/10 * * * * lynx -dump -accept_all_cookies http://test.testbox.test/cron.php > /dev/null
*/10 * * * * root lynx -dump -accept_all_cookies http://test.testbox.test/cron.php > /dev/null
*/10 * * * * wget -q -O /dev/null http://test.testbox.test/cron.php
and NONE of those works !!!!
When I run php script manual from webbrowser ... EVERYTHING works !!
My Apache uses php from module ... (I think so ).
So ... can anybody tell what's going wrong with cron ???
....lasse....
-
Hi everybody !
I have problem with running php script in cron. I've searched and read everything about my problem ... and nothing helps. My problem began in January 17. after sme-update/upgrade ...
Running that script is very important because my cms-systems e-mail notify does not work anymore :-(
I've tested:
*/10 * * * * root /usr/bin/php http://test.testbox.test/cron.php > /dev/null
*/10 * * * * /usr/bin/php http://test.testbox.test/cron.php > /dev/null
*/10 * * * * lynx -dump -accept_all_cookies http://test.testbox.test/cron.php > /dev/null
*/10 * * * * root lynx -dump -accept_all_cookies http://test.testbox.test/cron.php > /dev/null
*/10 * * * * wget -q -O /dev/null http://test.testbox.test/cron.php
and NONE of those works !!!!
When I run php script manual from webbrowser ... EVERYTHING works !!
My Apache uses php from module ... (I think so ).
So ... can anybody tell what's going wrong with cron ???
....lasse....
Remove the > /dev/null part and you should get a mail message to the admin which displays output of error messages for instance. It might have to do with cron not all jobs seem to be ran as as root, what are the rights and ownerships of the files?
-
Ok. /dev/null removed !!
MY cms is working normal www user ... in /ibays/Primary/html
I've allready changed cron.php attributes so that everybody can run it.
Let's look whats inside admin posts....
...lasse...
-
If http://test.testbox.test/cron.php is your server, then you simply execute the script like
*/10 * * * * /usr/bin/php -f /home/e-smith/files/primary/html/cron.php
Leave the redirect away and you should get an mail containing the error messages.
-
Mail is going out .. thanks Curly !!!
My problem is now:
1) I changed in crontab */10 * * * * to 0,30 * * * * and same line in templates 10runparts. I reconfigured systen from server-manager and booted system..... Cron do her job still every 10 minutes !!!!
2) php script output that I sent do >/dev/null sends email to admin ... not good :-(
It looks like from somewhere old settings controls system and the new ones does not !! Are there somekind database about systemsettings and now I can't update it.... How I do it ???
..lasse..
-
After changing something in the templates, you should expand the template.
/sbin/e-smith/expand-template /etc/crontab
Then you will probably have to stop / start cron.
service crond restart
Otherwise cron will still be running your old script.
If the > /dev/null doesn't catch all output, just add 2>&1 at the end:
*/10 * * * * /usr/bin/php -f /home/e-smith/files/primary/html/cron.php >/dev/null 2>&1
The >/dev/null takes care of the standard output, the 2>&1 takes care of the errrors.
-
This is very intresting ...
When I make:
/sbin/e-smith/expand-template /etc/crontab
every changes that I've done in 10runparts is coming in crontab ...
but when I make:
service crond restart
to restart crond ... nothing changes !!! Somewhere hides old values !!!! And I cant make any changes to cron !!!!
How I refresh those values .... Halting system, rebooting system does not work ?? SME-server should not be THAT secure :-)
..lasse..
-
*/10 * * * * /usr/bin/php -f /home/e-smith/files/primary/html/cron.php
To me it seems that you let the user as which to run the job is missing, is this not required?
Perhaps the /var/log/messages file displays some error messages about this?
If I look in my /etc/crontab I find instructions like this:
12 1 */7 * * root /sbin/e-smith/signal-event logrotate
I suspect that it should tun every 10 minutes when you change it to:
*/10 * * * * root /usr/bin/php -f /home/e-smith/files/primary/html/cron.php
(you might have to restart cron, but I am not sure about that.
-
*/10 * * * * /usr/bin/php -f /home/e-smith/files/primary/html/cron.php >/dev/null 2>&1
The >/dev/null takes care of the standard output, the 2>&1 takes care of the errrors.
And you should (almost) never redirect errors to /dev/null. OP is confused because he doesn't know what is going wrong. It's bad advice to suggest that the informative error messages should be thrown away without anyone having an opportunity to read them.