I have shell-script for restart some service in ruby file, kill process and run, and it's work. I want to run this shell-script every hour, so I put commands bash to crontab, cron running every hour but my shell-script only execute kill process, the three last command which is run 3 ruby files doesn't execute.
sudo pkill -9 -f '/home/myuser/.rvm/rubies/ruby-2.4.0/bin/ruby /home/myuser/subscribe.rb' sudo pkill -9 -f '/home/myuser/.rvm/rubies/ruby-2.4.0/bin/ruby /home/myuser/retry1.rb' sudo pkill -9 -f '/home/myuser/.rvm/rubies/ruby-2.4.0/bin/ruby /home/myuser/retry2.rb' sleep .5 nohup /home/myuser/.rvm/rubies/ruby-2.4.0/bin/ruby /home/myuser/subscribe.rb &! nohup /home/myuser/.rvm/rubies/ruby-2.4.0/bin/ruby /home/myuser/retry1.rb &! nohup /home/myuser/.rvm/rubies/ruby-2.4.0/bin/ruby /home/myuser/retry2.rb &!
0 */1 * * * bash -lc "/home/myuser/restart.sh"