0

I wrote this task for cron:

0 * * * * cd ~/projects/stat-eprorok-rails4/current && rvm use 2.0.0 do bundle exec rake vk_posts:update_likes RAILS_ENV=production

I do not understand why the task is not performed every hour, because this script works:

cd ~/projects/stat-eprorok-rails4/current && rvm use 2.0.0 do bundle exec rake vk_posts:update_likes RAILS_ENV=production
Temur
  • 21
  • 3

2 Answers2

1

the tilde(shorthand for home) might not have been initialized...try it with absolute path

Zoltán Haindrich
  • 1,788
  • 11
  • 20
0

The cd method is not designed for use with an application like cron, you need to use the full path for each command you want to run in that directory. For every file operation include the full file path.

stmfunk
  • 663
  • 5
  • 20