Bug 3935 - Schedule tasks periodically
Summary: Schedule tasks periodically
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Task Scheduler (show other bugs)
Version: Main
Hardware: PC All
: P5 - low enhancement with 5 votes (vote)
Assignee: Chris Cormack
QA Contact: Bugs List
URL: cgi-bin/koha/tools/scheduler.pl
Keywords:
Depends on: 1993
Blocks:
  Show dependency treegraph
 
Reported: 2009-12-16 12:45 UTC by Nicole C. Engard
Modified: 2023-11-17 01:03 UTC (History)
18 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 3935: Add support for recurring scheduled tasks (6.96 KB, patch)
2022-05-17 23:42 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 3935: Add support for recurring scheduled tasks (7.26 KB, patch)
2022-05-18 01:15 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 3935: Add support for recurring scheduled tasks (7.17 KB, patch)
2022-05-18 01:35 UTC, Lari Taskula
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:21:12 UTC


---- Reported by nengard@gmail.com 2009-12-16 00:45:11 ----

It would be nice to set the task scheduler to run a report periodically at a specific time - instead of just once



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:21 UTC  ---

This bug was previously known as _bug_ 3935 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=3935

Actual time not defined. Setting to 0.0

Comment 1 Martin Renvoize 2014-12-12 11:41:34 UTC
This is still true right?  I certainly can't see any way to schedule recurring tasks via the staff client yet...
Comment 2 verolencinas 2018-08-10 10:47:46 UTC
Hi, I would like this to be of higher importance.
There should be two options, one to make one scheduled run and the other to run periodically. So we could have weekly, monthly or yearly statistics for example.
Comment 3 Katrin Fischer 2018-08-10 15:25:39 UTC
Hi, the main problem is bug 1993, that needs to be resolved first. Please understand that this will need funding and/or resources in order to move forward.
Comment 4 Lari Taskula 2022-05-17 23:42:56 UTC Comment hidden (obsolete)
Comment 5 Lari Taskula 2022-05-18 00:04:38 UTC
(In reply to Katrin Fischer from comment #3)
> Hi, the main problem is bug 1993, that needs to be resolved first. Please
> understand that this will need funding and/or resources in order to move
> forward.

I just noticed this comment and the dependent Bug 1993 and I agree with what is discussed there. I'll leave the above patch here in case anyone finds it useful, but Bug 1993 seems like the correct way to go.
Comment 6 David Cook 2022-05-18 00:47:47 UTC
(In reply to Lari Taskula from comment #5)
> (In reply to Katrin Fischer from comment #3)
> > Hi, the main problem is bug 1993, that needs to be resolved first. Please
> > understand that this will need funding and/or resources in order to move
> > forward.
> 
> I just noticed this comment and the dependent Bug 1993 and I agree with what
> is discussed there. I'll leave the above patch here in case anyone finds it
> useful, but Bug 1993 seems like the correct way to go.

That's cool!

However, it's unlikely that I'll ever work on it at my day job, and I haven't been doing much Koha coding at night since 2020.
Comment 7 Lari Taskula 2022-05-18 01:15:21 UTC Comment hidden (obsolete)
Comment 8 Lari Taskula 2022-05-18 01:35:09 UTC
Created attachment 135085 [details] [review]
Bug 3935: Add support for recurring scheduled tasks

Tools->Task scheduler lacked the ability to repeatedly execute tasks.

This patch adds such functionality.

It adds a new parameter "--recurring" to misc/cronjobs/runreport.pl

After runreport.pl is executed and if --recurring is provided, we will now
schedule a new task with the same parameters.

To test:
1. Navigate to Tools->Task scheduler
2. Observe there is nothing that allows you to repeatedly execute the task
3. Apply patch
4. Refresh Tools->Task scheduler page
5. Observe new field "Recurring every" ... "minutes/hours/days..."
6. Check current server time
7. Add current server time + 1 minute to "Time" field
8. Add "1 minutes" to "Recurring every" field
9. Select a saved report (if you don't have one, create a new one)
10. Add your email address to "Email"
11. Click "Save"
12. Observe new row at "Jobs already entered" section and note down given
    datetime
13. Wait one minute
14. Refresh Tools->Task scheduler page
15. Observe updated row at "Jobs already entered" section, it should now
    have datetime + 1 minute of what you observed at step 12