Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 如何使用crontab执行脚本_Ruby_Linux_Bash - Fatal编程技术网

Ruby 如何使用crontab执行脚本

Ruby 如何使用crontab执行脚本,ruby,linux,bash,Ruby,Linux,Bash,我在文件夹路径中有一个脚本/home/rohit/Report/test.sh 我想每隔5分钟使用crontab运行此脚本 我用这些命令打开了任何类型的终端 crontab -e 在crontab中写这行 5 * * * * rohit /home/rohit/Report/test.sh 保存并退出 但它不执行脚本 我做错什么了吗 我的test.sh是 ruby file1.rb ruby file2.rb file1.rb和file2.rb也存在于该文件夹中我建议您使用gem来管理cr

我在文件夹路径中有一个脚本
/home/rohit/Report/test.sh
我想每隔5分钟使用
crontab
运行此脚本

我用这些命令打开了任何类型的终端

crontab -e
在crontab中写这行

5 * * * * rohit /home/rohit/Report/test.sh
保存并退出

但它不执行脚本

我做错什么了吗

我的
test.sh

ruby file1.rb
ruby file2.rb
file1.rb和file2.rb也存在于该文件夹中

我建议您使用gem来管理cron作业。

试试这个

*/5 * * * * /home/rohit/Report/test.sh

尝试使用ruby的完整路径