Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

ruby on rails - How to clean crontab created with Whenever at a staging server (RoR app deployed with Capistrano, to a server with RVM)

I have an RoR app, which was deployed with Capistrano to a staging server. The server has RVM to handle the Rubies. The app uses Whenever to create cron jobs.

The deploy works as expected, with Capistrano triggering Whenever to update the crontab with the new jobs.

My question is: how do I clean the crontab using whenever?

I've tried the command $ RAILS_ENV=staging bundle exec whenever -c, at the current folder of the app, but the crontab was not erased.

The only way I was able to erase it was using the command $ crontab -r, but I would like to know if it possible to use Whenever for this also.

question from:https://stackoverflow.com/questions/65847250/how-to-clean-crontab-created-with-whenever-at-a-staging-server-ror-app-deployed

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

To clean the crontab I had to use the Whenever command with the extended version of the flag:

$ RAILS_ENV=staging bundle exec whenever --clear-crontab

Not sure why...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...