iCyborg
iCyborg

Reputation: 4728

Cron (through whenever gem) not running

I am following railscast.

  1. I added whenever gem in Gemfile and ran bundle install
  2. have put this code in config/schedule.rb file

    every 1.minute do
      command "rm #{path}/tmp.txt"
    end
    
    every 2.minutes do
      command "rm #{path}/tmp.txt"
    end
    

I am trying to remove the tmp.txt file but it is not getting deleted. What am I missing ?

Upvotes: 0

Views: 54

Answers (1)

Billy Chan
Billy Chan

Reputation: 24815

The actual work is done by server's crontab command. "Whenever" gem is nothing but a nice tool to help you write cron commands and update easily.

Maybe you forget to update crontab? Try this

whenever --update-crontab store

Upvotes: 2

Related Questions