1

I am using the whenever gem to schedule tasks on OSX Mojave. In the scheduling file, I have

#config/schedule.rb
set :output, "log/cron.log"
every 1.day, at: '23:00' do
   rake 'util:something'
   runner 'User.something_else'
   command "echo 'I just want to see something happen'"
end

The rake, and runner methods work fine and I see output in the cron.log. However, there is no output from the command method, it just seems to be ignored. It may be something to do with user permissions, but I am running it from the base directory of my ruby on rails app, so I would have thought I would have the correct permissions.

How do I fix this?

Obromios
  • 15,408
  • 15
  • 72
  • 127

1 Answers1

0

For the 'command' method, it is necessary to specify the full path to the log files, so the output should something like:

set :output, 'user/sites/my_app/log/cron.log'
Obromios
  • 15,408
  • 15
  • 72
  • 127