Make a Ruby program a daemon?

后端 未结 5 789
旧巷少年郎
旧巷少年郎 2020-12-01 10:53

I want to write a Ruby program that will always be running in the background (a daemon) on my Mac.

Can someone point me in the right direction on how this would be d

5条回答
  •  清歌不尽
    2020-12-01 11:29

    Use Daemonize.rb

    require 'daemons'
    Daemons.daemonize
    

    Very simple sample: http://github.com/utkarsh2012/backitup/blob/master/backitup.rb

    How to install daemons gem:

    gem install daemons
    

提交回复
热议问题