Skip to content

require 'whenever/capistrano' leaves old crontab on deploy #654

@dphuang2

Description

@dphuang2

I am using Capistrano 3.6.0 to deploy and have setup deployment by placing:
require 'whenever/capistrano'
in my Capfile.
The issue is that when the whenever:update_crontab task is run when I "cap production deploy":

00:15 whenever:update_crontab
      01 ~/.rvm/bin/rvm default do bundle exec whenever --update-crontab PoGoBag --set environment=production --roles=web,app,db
      01 [write] crontab file updated
    ✔ 01 deploy@146.148.43.226 1.102s

it leaves behind the old crontab, thus forcing me to login to my server and manually run:

crontab -r
whenever -w

on every deployment.

My assumption is that this is because it leaves behind the crontabs from the old releases and when it writes the new crontab, it is being done in the new release, thus leaving a crontab for every release if you do not clear it.

Is there a way to fix this behavior?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions