Scheduled task cancellaton
-
Hi All,
Many years ago I wrote a feature for FOG 0.28 which allowed a scheduled task to cancel other tasks.
I am now evaluating FOG 1.2, and would like to know if and how I can get the change incorporated into the mainline FOG code (or as some kind of plugin).The problem the feature solves is that if I scheduled a virus scan at 1am, but some machines fail to wake-up-on-LAN, then when the users boot the machine later in the morning, the machine proceeds with the virus scan then, with no way of avoiding it, save going into FOG and cancelling the task.
So I wrote a cancellation task, which I schedule for 3am. Then, any Virus scan task that has not run by 3am is automatically cancelled, so the users could use the machine when they come in.
While I only implemented the UI to support a canccellation task for the virus scan, the cancellation task can be applied to any other type of scheduled task.
Any and all comments are welcome.
Cheers!
Nik -
This post is deleted! -
[ATTACH=full]1245[/ATTACH]
Maybe something like?
Or at least a cut off time. If task does not start after [B]X[/B] number of hours/min, then cancel task.
[url=“/_imported_xf_attachments/1/1245_Untitled.png?:”]Untitled.png[/url]
-
I think this feature would be a useful addition. We have a similar scenario that is a bit of a pain for us.
All of our IT suite PCs are set to re-image on a schedule outside of normal working hours. If for any reason a schedule fails to start, (whether that be because WOL doesn’t work, or someone physically switches off the PC at the wall), the task stays in the active task queue and runs the next time the PC is powered on.
The next time the PC is powered on, it’s normally because someone wants to use it, only to find that it’s re-imaging which will take 20-30 minutes rendering the PC unusable during that time.
The ability to add a threshold when scheduling a task would be useful. For example, if the task doesn’t start within say 15 minutes of it’s scheduled time, it’s automatically removed from the active task queue. That way if the re-imaging task fails to start for any reason, the PC will still be usable the next time it’s powered on.
Currently we have to monitor the task list and manually cancel any tasks that have not run that may cause a problem.
Thanks
-
[quote=“Nik777, post: 34029, member: 649”]Hi All,
Many years ago I wrote a feature for FOG 0.28 which allowed a scheduled task to cancel other tasks.
I am now evaluating FOG 1.2, and would like to know if and how I can get the change incorporated into the mainline FOG code (or as some kind of plugin).[/quote]Interesting that you already have written such a thing. I don’t know how useful, in today’s FOG, it really would be, but that’s not to say it couldn’t be included. I don’t know what the code looked like though so I don’t know where to begin in helping you out with
this.
[quote=“Nik777, post: 34029, member: 649”]
The problem the feature solves is that if I scheduled a virus scan at 1am, but some machines fail to wake-up-on-LAN, then when the users boot the machine later in the morning, the machine proceeds with the virus scan then, with no way of avoiding it, save going into FOG and cancelling the task.[/quote]While the feature solves this problem, one of the Features I’ve added to FOG is to check all hosts that currently have a task. If they have not checked in at all, they will be resent the WOL packet. The reason for this? Because I’ve seen some networks will, seemingly arbitrarily, block some systems from receiving the packet. Waiting a period of time and resending the packet seems to work. That’s not to say this wouldn’t still have it’s uses, but just saying that we’ve added checks and balances to try helping with problems such as these.
[quote=“Nik777, post: 34029, member: 649”]
So I wrote a cancellation task, which I schedule for 3am. Then, any Virus scan task that has not run by 3am is automatically cancelled, so the users could use the machine when they come in.While I only implemented the UI to support a canccellation task for the virus scan, the cancellation task can be applied to any other type of scheduled task.
Any and all comments are welcome.
Cheers!
Nik[/quote]I think the best approach for this would to create a TaskType that specifically does this. The weird thing about this method, and I’m guessing you figured out the kinks on this, would be that Tasks are typically associated with hosts. How would one create a task that really isn’t host associated? Furthermore, how could we get a “cancellation task” so it doesn’t require you going to the Host page to schedule?