For those following along, I have been modifying pseudocron for use with TightURL. Initially I rejected pseudocron and a similar solution as being too much effort to include and not quite what I needed. So I set about writing my own job scheduler for TightURL. At the point where I had an extremely primitive scheduler that only decided whether or not to run itself, I changed my mind again.
At this point, I felt I’d put in too much effort for what I had, which was a piece of code that did one thing and one thing only. It was capable of running something once per-minute using a method I felt was suitable for TightURL, but that “something” needed to be a more sophisticated system for running tasks. So I took another look at some GPL web-based job scheduling code, and now a modified version of pseudocron is now the only task my scheduler runs. All other tasks are expected to be run under the pseudocron subsystem.
The major modifications to pseudocron are as follows:
- crontab is now stored in a database
- Logs are now stored in either text files or a database, or both
- There is some failure detection for jobs, which causes the admin to be mailed
- Jobs normally only send mail to the admin when they output something, just like *nix Cron
- Jobs can be run in several different ways:
- Included (default method from unmodified pseudocron)
- Shell (Bash scripts, other PHP scripts, etc.)
- Network (URLs)
As soon as this work is done, I will integrate the code into TightURL, and use it to run the anti-abuse tasks and reports.