Share » Forums » Install & configuration » HELP .. Cron Errors !!!

HELP .. Cron Errors !!!

HELP .. Cron Errors !!!

Monday 20 October 2003 1:52:47 am - 7 replies

Author Message

Tony Wood

Monday 20 October 2003 2:35:48 am

Hi,

Looks like a permissions of file location error.

Try running
cd /home/mysite/www/

Then
php -C runcronjobs.php

Let me know what you get.

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Selmah Maxim

Monday 20 October 2003 2:49:07 am

Hi Tony ...

But how do I do this in Crontab ?!

something like this :
cd /home/mysite/www/ ; php -C runcronjobs.php

or ...?!

Selmah Maxim

Monday 20 October 2003 3:14:01 am

This my cron :

*/5 * * * * php -C /home/mysite/www/runcronjobs.php

this will run runcronjobs.php each 5 minute !

should i change this to :

*/5 * * * * cd /home/mysite/www/;php -C runcronjobs.php

?!

or should i make *.sh file with this 2 line and put on crontab :

cd /home/mysite/www/
php -C runcronjobs.php

?!?

Tony Wood

Monday 20 October 2003 3:36:03 am

Selmah,

I would be careful running the cron as root, just in case.. I run

su -l --command='cd /xxx/; php -C runcronjobs.php 1>/xxx/ez_cron' xxuser

This means xxuser has only rights to the folder and not to the entire system... just in case :)

Try from the command line first then cron it...

I hope this helps

Tony

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

Selmah Maxim

Monday 20 October 2003 3:47:47 am

Thx Tony ... But

Can you PLS give more explain about this, what the risk ?!

what the xxuser ... my user name or fake name or should i create a new user for this .... or what ?!

I`m on share host.

Selmah Maxim

Monday 20 October 2003 4:08:20 am

ok ..

with :
su -l --command='cd /xxx/; php -C runcronjobs.php 1>/xxx/ez_cron' xxuser

i get access error !

but with cd /xxx/; php -C runcronjobs.php
its work fine !

but still don`t know what the risk !

Tony Wood

Monday 20 October 2003 4:59:10 am

Selmah,

Once you have the cron working normally then you should try and lock it down further.
The risk of running a cron job as root is that someone could change or find a way of adding system commands to runcronjobs.php and these would then be run on your system as root user.

Note. The xxx was a directory where you have your project the xxuser is a user that has bash or a full shell access.

Tony Wood : twitter.com/tonywood
Vision with Technology
Experts in eZ Publish consulting & development

Power to the Editor!

Free eZ Training : http://www.VisionWT.com/training
eZ Future Podcast : http://www.VisionWT.com/eZ-Future

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu