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.


  • 2
    Is there any server management software, e.g. puppet, used on the server? – Jenny D says Reinstate Monica Oct 7 '13 at 15:35
  • Nope nothing like that as far as I'm aware... – Mark Davies Oct 7 '13 at 16:05
  • You mention editing a crontab file, what file are you editing? A file in /etc/cron.d/? A crontab spool file? Are you sure there isn't a bug in your edit script? I kinda suggest you look at switching over to files in /etc/cron.d/ They are less likely to be trashed. Do you know the specific times? Do you see anything in the log when the crontab gets trashed? – Zoredache Oct 7 '13 at 16:28

Argh! OK, this was a communication error. We're deploying a Rails app on the server which uses a gem called 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.

  • I presume you filed a bug report there? :) – rogerdpack Jul 9 '15 at 22:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.