开发者

Why using a cronjob in a cms/website?

开发者 https://www.devze.com 2023-01-09 20:42 出处:网络
I am working on an existing CMS. We were thinking if it would be usefull to work with a cronjob. When thi开发者_运维百科nking on this, we could only think on updating the search index for the cronjob,

I am working on an existing CMS. We were thinking if it would be usefull to work with a cronjob. When thi开发者_运维百科nking 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?


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.


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.


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消