Add a common function for hooks that only include files - fixes #747

Signed-off-by: emanuele <emanuele45@gmail.com>
Trying to make scheduled tasks easier to extend...I hope... - not tested

Signed-off-by: emanuele <emanuele45@gmail.com>