Cleanup trigger
- Old dirs: A cleanup method, erasing tmp-dirs that are older than N days. Removing a tmp directory should also run a qdel on the associated cluster job in case it is still hanging. This requires saving the job_id in the database.
- The other way around, jobs in error state should be detected and deleted. This also should trigger the 'done' page, setting an error flag. The email to the user can then signal the error.
This method could be triggered by each visit, or, maybe more robust, by a cron job.