Suppose I have the following cron entry:
* * * * * /bin/date
Now suppose that I want scripts that run both before and after the cron job runs.
I could modify the cron entry to look like this:
* * * * * /bin/prehook ; /bin/date ; /bin/posthook
Or if I wanted the exit code of the prehook to determine whether or not the date command runs, I could do this:
* * * * * /bin/prehook && /bin/date ; /bin/posthook
However, I'm looking for a solution that I might be able to apply globally to all cron jobs without editing every single crontab; I see this as analogous to pre-commit and post-commit hooks that you see in many version control systems.