I'd like to execute a task at a given time, once.
I know I can just use crontab -e to add it there, but I'd like to do that through a shellscript. crontab -e gives me some temporary file to edit which is unpredictable.
Also, once the task executes I'd like to remove it from the crontab again to make sure it'd not leaving behind mess.
So is there a standardized way to add/remove entries from my personal crontab through a script?
I know I could roll my own system: Have a script that executes every minute that executes and deletes .sh files from a folder and have my "addtask" script create .sh files in that folder, but before rolling my own I wonder if there is something already.
If it matters, I use Mac OS X and zsh but I wanted to use something that works on other *nixes as well.
atshould do exactly what you want. Why make things hard on yourself by insisting on a more complicated solution? – Wim Coenen Jan 9 '11 at 12:35crontab -ewithEDITORset to an automated program instead of an interactive editor), but it's definitely not a way to do what you want. It would be a way to set up a recurring task. For a one-off,atis the appropriate tool. – Gilles Jan 9 '11 at 13:14