Skip to content

Mina deploy and cron problems #616

Open
@AnubixXx

Description

@AnubixXx

Hi,

I have some issues with Whenever gem and Mina deploy.

In my schedule.rb I have:

env :PATH, ENV['PATH']

every 12.hours do
  rake "-s sitemap:refresh"
end

In deploy.rb I have:

require 'mina/whenever'
.................
and in deploy do
invoke :'whenever:clear'
invoke :'whenever:write'
invoke :'deploy:cleanup'

The reason why I don't use whenever:update is that it doesnt work correctly. It updated cron one deploy step back. Well, but it isn't that problem. This command create this crontab -l:

# Begin Whenever generated tasks for: 46.101.149.216_production
PATH=/home/thomas/myapp/releases/36/vendor/bundle/ruby/2.2.0/bin:/home/thomas/.rbenv/versions/2.2.3/bin:/home/thomas/.rbenv/libexec:/home/thomas/.rbenv/plugins/ruby-build/bin:/home/thomas/.rbenv/shims:/home/thomas/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

0 0,12 * * * /bin/bash -l -c 'cd /home/thomas/myapp/current && RAILS_ENV=production bundle exec rake -s sitemap:refresh --silent'

# End Whenever generated tasks for: 46.101.149.216_production

Well, it's really weird the PATH part. And of course, cron doesn't work. Maybe it's because env :PATH, ENV['PATH'], but before it didn't work as well. I am using rbenv. I have no idea how cron works and I can't repair it. But when I go to /home/thomas/myapp/current folder on server and run command manually, sitemap is created, so command works correctly.

Thanks for help.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions