crontab 没有 find/recognize 路径
Crontab dont find/recognize path
我正在使用 osx 并在路径中创建了一个 ruby 脚本:/Users/diogo/workspace/outros/crawler_trf
名称为 get_news.rb
所以我尝试使用以下行通过 crontab 执行它:*/1 * * * * 'ruby /Users/diogo/workspace/outros/crawler_trf/get_news.rb' > /tmp/crawler_trf.out
并且出现错误:/bin/sh: ruby /Users/diogo/workspace/outros/crawler_trf/get_news.rb: No such file or directory
我真的一直在寻找我的答案,但我一无所获。
cron
正在输入您的命令:
'ruby /Users/diogo/workspace/outros/crawler_trf/get_news.rb' > /tmp/crawler_trf.out
到 /bin/sh
按原样但没有 'ruby /Users/diogo/...'
命令,可能有一个 ruby
命令可以将 /Users/diogo/...
作为参数,但删除报价:
*/1 * * * * ruby /Users/diogo/workspace/outros/crawler_trf/get_news.rb > /tmp/crawler_trf.out
您可能还想包括 ruby
的完整路径,或者至少确保 crontab
.
中有 PATH
设置
我正在使用 osx 并在路径中创建了一个 ruby 脚本:/Users/diogo/workspace/outros/crawler_trf
名称为 get_news.rb
所以我尝试使用以下行通过 crontab 执行它:*/1 * * * * 'ruby /Users/diogo/workspace/outros/crawler_trf/get_news.rb' > /tmp/crawler_trf.out
并且出现错误:/bin/sh: ruby /Users/diogo/workspace/outros/crawler_trf/get_news.rb: No such file or directory
我真的一直在寻找我的答案,但我一无所获。
cron
正在输入您的命令:
'ruby /Users/diogo/workspace/outros/crawler_trf/get_news.rb' > /tmp/crawler_trf.out
到 /bin/sh
按原样但没有 'ruby /Users/diogo/...'
命令,可能有一个 ruby
命令可以将 /Users/diogo/...
作为参数,但删除报价:
*/1 * * * * ruby /Users/diogo/workspace/outros/crawler_trf/get_news.rb > /tmp/crawler_trf.out
您可能还想包括 ruby
的完整路径,或者至少确保 crontab
.
PATH
设置