Skip to Content

Cronjob schedule data !

Hello,

I have a CronJob and I need to add a trigger for it to start the cronjob every 1 hour using ImpEx script to retrieve the orders that was added to the system since last execution. I tried using the ImpEx scripts on the Wiki; the result was "Import successfully" but no effect found on the cronjob's "Time Schedule" section and of course the cronjob wasn't starting every 1 hour.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 11, 2014 at 08:18 PM

    Hi,

    I used this way:

     INSERT_UPDATE Trigger ; cronJob(code)[unique=true]       ; second ; minute ; hour ; day ; month ; year ; relative ; active ; maxAcceptableDelay
                           ; my-cronjob ; 0      ; 0      ; 1    ; -1  ; -1    ; -1   ; true     ; true   ; -1          
    
    
    

    Notice active=true and relative=true.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 14, 2014 at 03:00 PM

    Thanks for your reply Miroslaw. Now the trigger has been added to the cronJob, but it still retrieves all the data instead of only the data that was added in the last hour. Any ideas?

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Saleh,

      You can add new property to your CronJob type that will hold Date of last successful execution. Then in your JobPerformable you can limit the data retrieved using new property value. At the end of execution you need to update the property value and save the cronjob instance.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.