From: Robert Klemme Date: 2012-01-24T18:38:50+09:00 Subject: Re: Register an action to be done at a later time On Tue, Jan 24, 2012 at 10:18 AM, Marc Heiler wrote: > Hi. > > I have a "pseudo-shell" and this shell allows me to do something like: > > "in 30 minutes do start alarm" > > ^^^ In 30 minutes, mplayer would play some files. > > So far so fine. Right now when I quit the shell though, this will > never be done. So my idea of course is to store this in a file, and > on startup of my pseudo-shell, load all those registered tasks. > > Now here is my question - what would be the best way to do this? > > Should I store in a yaml file, and on startup load all those yaml > files and do a Thread.new {} ? > > Should I use marshall instead? > > Or any other ideas? cron, anacron, at. > Am very grateful for ideas! I sound extremely incompetent right now > because I have never tried to write something like a cron-replacement. Why do you want to write a cron replacement? > (In the future, perhaps a daemon should be running that is doing this on > its own... but for now, I want to keep it simpler.) Right, you should have a demon and your script would only be the front end. You could as well make your script / shell create at or cron jobs in the background so it would just be a convenient proxy for those. You could leverage the robustness of those tools while providing a convenient user interface. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/