Linux – Why is crontab file periodically overwritten

cronlinuxUbuntu

I have a Ubuntu 12.10 server with an nginx user that I use to edit a crontab file. Periodically (maybe once every few hours? it's hard to tell), I notice that edits I have made as the nginx user have been deleted, and when I type crontab -e my last changes have disappeared. Once I make the changes again and save, the new file installs correctly, and the jobs run successfully until it reverts again at some stage in the future.

I am not a server admin expert, so I guess I'm asking what the best way to debug something like this is? Or if this is a common problem what the usual mistakes are that I might be making.

Thanks!

Best Answer

Argh! OK, this was a communication error. We're deploying a Rails app on the server which uses a gem called Whenever:

https://github.com/javan/whenever

This gem was overwriting the changes I made in the crontab file each time I deployed. Solutions are to either remove the gem, or to use it to set up the jobs.

Related Topic