Jump to content

Lazy Cron vs Cron : Which one should I use or both?


Vineet Sawant
 Share

Recommended Posts

Hello,

I've been reading about Cron & Lazy Cron for days, but since my knowledge of programming is fairly limited, I couldn't get a single task done, so I'm here again to seek some help, probably learn a thing or two.

Firstly, Cron is task scheduler run by the server, right?  And lazy cron is run by ProcessWire which runs only when page is loaded??

If lazy cron runs only when pages are loaded, how will it run periodically?

My requirement is, on every first minute of a day, a specific page(which will contain some code to perform several tasks) should run.

Since right now,  the code doesn't need any specific time to run, I just run the page manually every morning. But there will be a time when it'll need to run at very specific time.

I wish to know if this requirement can be fulfilled by Lazy Cron or will I also need to use cron?

TL;DR

I wish to know what's the difference between Lazy Cron  & CRON? And when to use which?

Also, I need to run a PW page specifically a minute after every midnight. Will it possible only with Lazy Cron or will I have to use Cron as well?

For running URL instead of file in CRON, I'm looking at this solution by Horst.

Link to comment
Share on other sites

With Lazy Cron you will not be able to guarantee exactly when a task will be run - a page on the site will need to be loaded, just as you noted. You could skip lazy cron altogether and use cron directly on your server, or you could use the technique that Ryan mentions at the bottom of:

http://modules.processwire.com/modules/lazy-cron/ (How to make it not-lazy)

If you are running your site on a shared host, you will probably find a tool in your control panel for setting up and managing cron jobs. If you don't have a control panel, you can simply google it and you'll get lots of tutorials:

https://www.google.com/search?q=limux+manage+cron+job

  • Like 3
Link to comment
Share on other sites

  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...