koenHuybrechts
koenHuybrechts

Reputation: 878

Why using a cronjob in a cms/website?

I am working on an existing CMS. We were thinking if it would be usefull to work with a cronjob. When thinking on this, we could only think on updating the search index for the cronjob, so we have no idea if we should add the cronjob to our CMS or not ...

What do you think?

Upvotes: 0

Views: 148

Answers (4)

Yves M.
Yves M.

Reputation: 3318

If it is no customer requirement just leave it. It only adds complexity and has to be testet without adding any real value.

Upvotes: 0

gtrak
gtrak

Reputation: 5676

Instead of using cron to execute your scripts directly, you could implement a scheduler in whatever language you're using and just have cron give it a heartbeat. I would do this if I had multiple tasks to schedule for my site and didn't want to scatter logic everywhere.

Something like this spec: http://code.google.com/p/djangotaskscheduler/wiki/OriginalRequirements

Upvotes: 0

CEich
CEich

Reputation: 33474

Are you asking whether or not it would be useful, I think that it absolutely can be for certain tasks.

Having done some Drupal development, I know that it tends to use cronjobs for aggregating feeds, caching pages, creating logs and a whole host of other things.

see http://drupal.org/cron for a more in-depth example/explanation.

Upvotes: 4

Jay
Jay

Reputation: 1356

If you have a valid need to perform some batch type of operations off of your main server then a cronjob makes perfect sense, but I wouldn't start adding them just for the sake of having them.

Upvotes: 1

Related Questions