set job each hours at 00/15/30/45 #18

Closed
opened 2025-12-29 00:21:18 +01:00 by adam · 2 comments
Owner

Originally created by @marcosomma on GitHub (May 18, 2015).

Hi there,
So I need execute a job each hour, each 15 minutes exactly, independent from the deploy hour.

It's the first time that I use this GEM and it's my first app in Ruby :)

In node.js my code to do this is

var job = new CronJob('0 */15 * * * *', function () {
        do something....
    }, null, true, "");

I try 2 different approach

1) every hours at : 00/15/30/45

Crono.perform(myJob).every 1.hours,          at: {min:00}
Crono.perform(myJob).every 1.hours,          at: {min:15}
Crono.perform(myJob).every 1.hours,          at: {min:30}
Crono.perform(myJob).every 1.hours,          at: {min:45}

NOT WORK! period should be at least 1 day to use 'at'

2) every days each hours at : 00/15/30/45

Crono.perform(myJob).every 1.day,          at: {hour: *, min:00}
Crono.perform(myJob).every 1.day,          at: {hour: *, min:15}
Crono.perform(myJob).every 1.day,          at: {hour: *, min:30}
Crono.perform(myJob).every 1.day,          at: {hour: *, min:45}

NOT WORK! syntax error, unexpected * (SyntaxError)

Any suggestion??

Originally created by @marcosomma on GitHub (May 18, 2015). Hi there, So I need execute a job each hour, each 15 minutes exactly, independent from the deploy hour. It's the first time that I use this GEM and it's my first app in Ruby :) In node.js my code to do this is ``` var job = new CronJob('0 */15 * * * *', function () { do something.... }, null, true, ""); ``` I try 2 different approach <b>1) every hours at : 00/15/30/45 </b> ``` Crono.perform(myJob).every 1.hours, at: {min:00} Crono.perform(myJob).every 1.hours, at: {min:15} Crono.perform(myJob).every 1.hours, at: {min:30} Crono.perform(myJob).every 1.hours, at: {min:45} ``` NOT WORK! period should be at least 1 day to use 'at' <b>2) every days each hours at : 00/15/30/45 </b> ``` Crono.perform(myJob).every 1.day, at: {hour: *, min:00} Crono.perform(myJob).every 1.day, at: {hour: *, min:15} Crono.perform(myJob).every 1.day, at: {hour: *, min:30} Crono.perform(myJob).every 1.day, at: {hour: *, min:45} ``` NOT WORK! syntax error, unexpected \* (SyntaxError) Any suggestion??
adam added the bug label 2025-12-29 00:21:18 +01:00
adam closed this issue 2025-12-29 00:21:18 +01:00
Author
Owner

@plashchynski commented on GitHub (May 28, 2015):

@marcosomma Thank you for the report. Now you can setup it as:

Crono.perform(myJob).every 1.hours,          at: {min:00}
Crono.perform(myJob).every 1.hours,          at: {min:15}
Crono.perform(myJob).every 1.hours,          at: {min:30}
Crono.perform(myJob).every 1.hours,          at: {min:45}
@plashchynski commented on GitHub (May 28, 2015): @marcosomma Thank you for the report. Now you can setup it as: ``` ruby Crono.perform(myJob).every 1.hours, at: {min:00} Crono.perform(myJob).every 1.hours, at: {min:15} Crono.perform(myJob).every 1.hours, at: {min:30} Crono.perform(myJob).every 1.hours, at: {min:45} ```
Author
Owner

@marcosomma commented on GitHub (Jun 3, 2015):

Thanks!

@marcosomma commented on GitHub (Jun 3, 2015): Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/crono#18