Rohit Kumar
Rohit Kumar

Reputation: 85

How do I execute script using crontab

I have a script inside a folder path /home/rohit/Report/test.sh I want to run this script using crontab every 5 minutes

I opened terminal any type these command

crontab -e

write this line in crontab

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

save and exit.

but It does not execute script.

Am I doing anything wrong.

my test.sh is

ruby file1.rb
ruby file2.rb

file1.rb and file2.rb are also present in that folder

Upvotes: 1

Views: 51

Answers (2)

Arnab Nandy
Arnab Nandy

Reputation: 6692

Try this instead,

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

Upvotes: 2

rubycademy.com
rubycademy.com

Reputation: 529

I advice you to use whenever gem to manage your cron jobs.

Upvotes: 1

Related Questions