5

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!

Mark Davies
  • 181
  • 6
  • 2
    Is there any server management software, e.g. puppet, used on the server? – Jenny D Oct 07 '13 at 15:35
  • Nope nothing like that as far as I'm aware... – Mark Davies Oct 07 '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 07 '13 at 16:28

1 Answers1

0

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.

Mark Davies
  • 181
  • 6