Free Logo Creator

Logo creation is a long, drawn-out creative process that can cost millions. But a good logo doesn't have to cost a fortune, and you don't even need to hire a professional design team. Check out Logo Creator (Win | Mac) to get started, read our article on obtaining your own Free Logo Creator.

Create a Website and Make It Profitable

Use Site Build It! to get up and running with your own website, no technical knowledge required, and get ready to cash in on a slice of the giant online advertising industry. Check out Site Build It! to get started.



Dec 16 2006

Cron runs are off by x hours


Filed under: Service Providers » Hosting,
Tools:

Cron Runs Are Off By Several Hours

Do you have a cron-based Drupal event that is off by several hours? Your problem is most likely not with your date settings, as I first suspected when I encountered this problem with the "Recent Popular Content" block resetting at an odd time (5 hours too early, as I wanted it to reset at midnight every night). Rather, it may have to do with cronplus settings.

Adjusting Cronplus Time Settings

If you have cronplus installed, you can go into admin -> settings -> cronplus, and under "preferred hour" pick an hour that will negate the time offset you are experiencing. For example, in my case my recent popular content block was resetting 5 hours too early, which means to cronplus it was firing off at what it presumed was midnight. Therefore, if cronplus reset the popular content block 5 hours late, it would in fact be resetting it at midnight my time, which is what I wanted.

Checking Cronplus Offset

You can verify the offset in your cronplus logs (admin -> logs -> cronplus messages). You'll notice an entry like the following:


cronplus | 2006-12-16 18:59 | Processing hourly cron for 2006-12-16 22:59:51 UTC, ... | Anonymous

What this tells me is that the cronplus event scheduled to fire off at 23 UTC, actually occured at 19 EST (my time zone), which does not account correctly for the timezone difference (there's 5 hours difference between UTC and EST, not 4). This means my server time is one hour different from my actual time zone. You can verify this by running the PHP date() function and having it return the timezone.

No votes yet
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Textual smileys will be replaced with graphical ones.

More information about formatting options

CAPTCHA
This question is used to make sure you are a human visitor and to prevent spam submissions.