Mac下用Whenever和Cron Job集成Rails

https://github.com/javan/whenever

http://stackoverflow.com/questions/14612818/whenever-gem-i-set-output-but-the-logfile-doesnt-show-up-where-id-expect-it

http://stackoverflow.com/questions/15395479/using-cron-on-mac-osx-mountain-lion

05 15 * * * bash -l -c 'cd /Users/lane/projects/duokong && bin/rails runner -e development '\''Index.auto_generate'\'' >> log/www.log 2>&1'
在15点05分去那个目录执行一段代码,并把日至写入。其实最终并没有用到whenever在Mac下。因为Cron 已经帮我完成了。

但Ubuntu下就要用到whenever了。

猜你喜欢

转载自zhangjian1982.iteye.com/blog/2105736
今日推荐