I want to run the following task as a daemon (infinite loop)
restart the docker containers and its tasks every 6:00 and 12:00
docker exec EZUSer_star_1 ruby star/star.rb&
docker exec EZUSer_tiger_1 ruby tiger/tiger.rb&
BUSY_WAITING_HERE except if 6:00 or 12:00 then just keep going
Is there any suggestion to gurantte the above job can run for months or years ?
I don't want to do it with
I need application level
Is there any Ruby DSL or library can let me do the kind_of job easier or robust.
If you are looking for a Ruby scheduler, Rufus Scheduler is the best one that I know about.
running it in a forever loop is probably not a good idea. In general, bad things happen to well-behaved processes all the time (oom killer, failure that leaves things in a dirty state you cannot recover from without releasing all resources, etc).
If you want to go ahead, make sure that you have something (externally) that checks if the process is running and restarts it (supervisord/monit/etc).