Lessons in Systems Administration… (learned the hard way by a n00b)

If you configure your system to stop and start a service once a day, make sure you verify that it works correctly.

Telling cron:
@daily dropbox stop (ie kill the dropbox process)
@daily dropbox start (and then start it again)
does not guarantee that it will execute in that order.

I know now to KNOW that @daily mean sometime near midnight, not necessarily in the order in your crontable.

A safer way to do the above is:
00 00 * * * dropbox stop (ie kill the dropbox process at 00:00 every day)
05 00 * * * dropbox start (and then start it again at 00:05 every day) (Yes, I know it looks backwards, but I checked it.)

The short version of the story is that my server was starting the dropbox service and then a second later stopping it.  Pity I didn’t notice several months ago when I made this change.

Lessons to take home:
1) Verify that changes work the way you want them to.
2) Assume cron will do it wrong.
3) Be more specific.   “00 00 * * *” may take more typing than @daily, but will guarantee (more) correctness.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.