cancel
Showing results for 
Search instead for 
Did you mean: 

Cronjob schedule data !

former_member634278
Participant
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

former_member634278
Participant
0 Kudos

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?

Former Member
0 Kudos

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.