ronnix/fabtools — pull request #21 by jaap3 (2012-04-10 11:13:01+00:00)
Title: Added CrontabManager

I've ported the crontab manager from the recipe I mentioned (and added unittests).

The thing I'm now struggling with is the already existing add_task (and add_daily) functions. The add_task basically just creates a new cron file each time it's used.

The manager is able to add (and remove) entries to/from existing crontab files. It finds entries by looking for special markers. These markers contain the "name" of the entry. I thought about using the name that's passed to the task add_task, but that one is already used to generate the cron file name.

I'm convinced the manager can be really useful, but can't find a way to neatly integrate it with fabtools... I'm hoping you can.

The basic use case is that for one project I'd like to have just one cron file that describes all tasks for that project's deployment. So basically I'd like to create a cron file named after the project and then add tasks to it (and maybe later remove some).