Currently, I'm working on a project to manage maintenance windows on a database of servers, etc. Basically, I only need to be accurate down to the hour, but allow for them to be set to allow, or disallow, for each day of the week.
I've had a few ideas on how to do this, but since I work by myself, I'm not wanting to commit to anything without some feedback.
To visualize this, it's something like the flowing "graph"
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
-------------------------------------------
5AM |allow|allow|allow|deny |deny |allow|allow|
-------------------------------------------
6AM |allow|deny |deny |deny |deny |deny |allow|
-------------------------------------------
7AM |allow|deny |deny |deny |deny |deny |allow|
-------------------------------------------
8AM |allow|deny |deny |deny |deny |deny |allow|
-------------------------------------------
9AM |allow|deny |deny |deny |deny |deny |allow|
-------------------------------------------
... etc...
Is there a standard way of doing this or a resource that might give me some ideas to...
- Make a format that can be saved and restored easily
- Make it searchable within the database (for example, not having to deserialize it to search for a time)
[Update]
It is worth mentioning that a day could, even though unlikely, be set to "allow, deny, allow, deny...etc...". The span isn't guaranteed to be the only one for the whole day.
This is also not the only schedule, there will be hundreds of devices each with their own schedule, so it's going to get hairy... lol??
Rob asked if each week needed to be tracked - It does not. This is a generic schedule that will apply to the entire year (regularly scheduled maintenance)