Closed (fixed)
Project:
Hosting Site Backup Manager
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2013 at 20:30 UTC
Updated:
21 Nov 2014 at 21:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
helmo commentedYes, sounds reasonable. A global setting should suffice.
I guess the best place would be hosting_backup_queue_queue(), unless the queue API could support a concept of time constraints.
Comment #2
ergonlogicAgreed, wrapping everything in hosting_backup_queue_queue() in a check against our window parameters should do it. To begin with, a window beginning- and end-time should be sufficient, but it'd eventually be nice to be able to also specify the days of the week (in a multi-value select list, or something) that backups are allowed. That way weekly backups could be scheduled with quite a bit of granularity. The UI could get pretty confusing though...
I think enhancing the queue API in core would probably better be served by making it really pluggable, so something like Jenkins could be used for this. But that'll have to wait for some more significant re-factoring of Aegir core.
Comment #3
gboudrias commentedI tried my hand at the proposed implementation. See attached patch.
I planned for this patch to be simple but it got rather long. Maybe it should go into a submodule? Not sure.
The backup manager admin interface would now give an "Illegal string offset" warning when the time variables are set, but it seems to be a problem with the Date API module, so I'm not sure how much hassle it's worth.
Since I used the Date module, I added a dependency to Date API. I'm also not entirely certain it's worth it, but dates are hard enough as it is.
Comment #4
ergonlogicI think it'd be simpler to just save the time as text and validate that it falls between 00:00 and 23:59. Adding date.module as a dependency seems like real overkill.
Also, I think having this as a sub-module would be best.
Comment #5
gboudrias commentedOkay, changed the date-text to normal textfield with just a little validation (it's so much simpler now!).
Also I put all that in a submodule and made it its own feature.
Comment #6
gboudrias commentedComment #7
gboudrias commentedFYI, deployed the patch to a production server, will report if it worked tomorrow.
Comment #8
gboudrias commentedSeems to work, please review :)
Comment #9
gboudrias commentedThis is tested on at least 4 production servers now, I think it's safe to commit it. I can do it myself if you give me access.
Comment #10
helmo commentedGo ahead, you have access.
Comment #12
gboudrias commentedThanks :)