Trying to execute shell script from crontab, every 10 seconds but it is not working for me
* * * * * sleep 10 /path/dataimport.sh
script just has one command rake db:dataimport
Trying to execute shell script from crontab, every 10 seconds but it is not working for me
* * * * * sleep 10 /path/dataimport.sh
script just has one command rake db:dataimport
The highest resolution for cron is minutes, so you can make the script run every minute like this :
* * * * * * /path/to/script.sh * * * * * root $APP_DIR/script/dataimport.sh and * * * * * $APP_DIR/script/dataimport.shif you really want to do it in a simple way..you must use Whenever Gem,made only for this purpose so that you can use plain simple words instead of scripting language for working on Cron jobs.
install it,generate the schedule.rb file using the generator and write the recurring tasks easily.
every 10.seconds do command "/usr/bin/my_great_command" end you can also use:-
##to run the scripts in schedule.rb bundle exec whenever ##update schedule.rb and run this to update and view your crontabs whenever --update-crontab