how to run sunspot reindex in background for every four hours
问题 I want to execute rake sunspot:reindex RAILS_ENV=production command for every four hours. To achieve this i have written simple bash script using shell programming. I will run successfully in terminal but if i tried to run it in crontab then it is not working. Operating system which am using is centos. Here is my bash script code #!/bin/bash #export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin export PATH=/usr/local/rvm/gems/ruby-1.9.2-p290/bin:/usr/local/rvm/gems/ruby-1