Cronjobs

edited April 2011 in Modules
Hi,
Just wonder how the cronjob work , normally I just setup in by using crontab -e , since we can setup in the module now , do we need to add the crontab.php into crontab ?

Comments

  • edited 7:03AM
    oh it seem like it will auto added to the cronjob, just to confirm this is how it work ?
  • edited 7:03AM
    I realized the documentation on the server needed to be updated. Have you read this yet?
    http://www.getfuelcms.com/user_guide/modules/cronjobs
  • edited 7:03AM
    yup , i read that but i thought we still need to do some manual work in order for the cronjob to run , didn't know it will just insert the cronjob directly to the crontab.
  • edited 7:03AM
    Sorry for the delay in getting back to you. When you say manual work do you mean like changing paths? Basically, it does the same thing you do for setting up crontabs by calling crontab -e etc. There is a Cronjob class (fuel/modules/cronjobs/library/) that is a wrapper around it if you are interested. Does that answer your question?
  • edited 7:03AM
    so far I have some progress on this, will send in a patch later, but now one bigger problem is when the script is run under www-data permission , it can't really perform crontab...
  • edited 7:03AM
    Did the patch you submitted regarding the user fix this issue for you?
  • edited 7:03AM
    nope i submitted patch for cronjobs, not really related my problem.

    Now the problem more like when the script is run under www-data ownership, the cronjobs that created is belong www-data also , just wonder is there way to create the cronjobs under my user acccount or not and what will be the best practice ?
  • edited 7:03AM
    Setting the user and password in the cronjob config didn't change the ownership for you?
  • edited 7:03AM
    unless www-data have the ownership to run sudo ? i think standard pratice people won't allow that happen ?
  • edited 7:03AM
    According to what I've read, you can execute shell commands as different users by first echoing out the password. It's not as secure but can be done according to these links:
    http://php.net/manual/en/function.exec.php
    http://php.net/manual/en/function.shell-exec.php

    When we set them up, we have them run under the php user normally.
  • edited 7:03AM
    yup I understand how the code work , i send it a patch yesterday for this also , but it doesn't resolve my problem, I wonder is that because the setup of server ? now i just settle to leave all cronjob belong to www-data in stead of my user account.

    Just wonder any other user raise up this issue ?
  • edited 7:03AM
    No one has raised up any other issue at this point but I wouldn't discount it just because of that. Do you have a different server environment that you can try to see if it is the server or if it may be an issue with the code?
Sign In or Register to comment.