Schedule jobs in Gearman

98 views
Skip to first unread message

Shaheer

unread,
Mar 5, 2019, 2:01:13 AM3/5/19
to Gearman

I want to schedule a job in Gearman. I found some options like SUBMIT_JOB_SCHED and SUBMIT_JOB_EPOCH from Gearman protocol documentation here. But I did not find any implementation on any existing Gearman server.

Is it possible to schedule a job in Gearman? Is there any example that I can refer to? (prefer python)

I also found with a persistent Gearman queue, there is a column called when_to_run INT from here. I put the epoch time directly in the database column and tried without luck.

Please help if you have done this, that is scheduled a job in Gearman for a specific date and time.

Edward J. Sabol

unread,
Mar 5, 2019, 4:26:10 AM3/5/19
to gea...@googlegroups.com, shaheer...@gmail.com
This feature is not currently implemented in gearmand. There's an issue for it in GitHub with some discussion:

https://github.com/gearman/gearmand/issues/101

Feel free to contribute a patch as a pull request which implements it, along with working test(s).

The recommendation is to use the "at" command to submit the job at the date/time you want. Because this can be achieved relatively easily with the "at" command, I suspect nobody has felt it's been worth the effort to implement this feature in gearmand..

Depending on your Linux distribution, you might need to install or activate "atd" (the "at" daemon):

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sect-atd-running
https://www.maketecheasier.com/schedule-commands-linux-with-at/
https://www.tecmint.com/linux-cron-alternative-at-command-to-schedule-tasks/

Hope this helps,
Ed

Shaheer

unread,
Mar 5, 2019, 5:19:30 AM3/5/19
to Gearman
Thankyou. I will go with the "at" command.
Reply all
Reply to author
Forward
0 new messages