Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
2  
Is there any server management software, e.g. puppet, used on the server? –  Jenny D 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

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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