1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Cronjob in batch mode?

Discussion in 'XenForo Development Discussions' started by Helmut2509, Apr 4, 2014.

  1. Helmut2509

    Helmut2509 Member

    In one of my XenForo-AddOns I implemented a cronjob, which runs more than one hour.
    the sysadmin told me, that for technical reasons such a job has to run in batch mode.
    any idea how this can be achieved?
     
  2. AndyB

    AndyB Well-Known Member

    Can you describe the problem in more detail.
     
  3. Helmut2509

    Helmut2509 Member

    Normally a XenForo cronjob runs as a web application , but according to my sysadmin there are some serious drawbacks when such a job runs for a long time. So the job has to run in batch mode.
     
  4. Adrian Schneider

    Adrian Schneider Active Member

    If a cron job runs for an hour, it shouldn't be a cron job. Either break it into smaller, more frequent jobs, or have it running as a daemon properly.

    If you insist on running it periodically through XenForo, you could always spin up a new process to do it. Something like...

    Code:
    exec('php your_file.php &');
     
  5. AndyB

    AndyB Well-Known Member

    Please indicate what you mean by "long time".
     

Share This Page