Announcement

Collapse
No announcement yet.

controlling cron jobs from a module

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    controlling cron jobs from a module

    Hi folks --

    I've been asked to quote on a custom job that will involve using cron to trigger store actions at specific dates & times, selected in advance by the store manager. He may not want to mess around with cron jobs in the control panel. I'd like to put some settings on an admin page that he can use for this.

    I've done some reading on the format of crontab files, and I can write a module that works with that. But where is this file located in a typical Miva store? And can a module edit the file, or will there be permission problems?

    And of course, if anyone has an alternative, non-cron solution, please chime in! In case it matters, this will be used to trigger one-time events, not something that needs to run on a regular schedule.

    Thanks --
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    #2
    Re: controlling cron jobs from a module

    Don't think its going to happen easily Kent. Most systems' crontab file is in /etc/ where Miva Empresa cannot read or write. You could have your module generate a cron file which a system command could copy to the right place; but then you probably would not need a module.



    Originally posted by Kent Multer View Post
    Hi folks --

    I've been asked to quote on a custom job that will involve using cron to trigger store actions at specific dates & times, selected in advance by the store manager. He may not want to mess around with cron jobs in the control panel. I'd like to put some settings on an admin page that he can use for this.

    I've done some reading on the format of crontab files, and I can write a module that works with that. But where is this file located in a typical Miva store? And can a module edit the file, or will there be permission problems?

    And of course, if anyone has an alternative, non-cron solution, please chime in! In case it matters, this will be used to trigger one-time events, not something that needs to run on a regular schedule.

    Thanks --

    Comment


      #3
      Re: controlling cron jobs from a module

      Set up a cron job to read a file you create every 30 minutes or something.

      Then write / rewrite / append the file whenever you need, adding in checks for the time...
      ie - if the time is > 5:22 and < 5:40 then do this.....

      I have something similar - although not a module - thats part of our order management system.
      It won't run things at exact times, but you can narrow it down.

      Not sure the overhead it may create if it runs to often.

      Bill
      William Gilligan - Orange Marmalade, Inc.
      www.OrangeMarmaladeinc.com

      Comment

      Working...
      X