Periodic maintenance function

13 views
Skip to first unread message

Anthony McLin

unread,
Dec 18, 2009, 2:25:02 PM12/18/09
to joomla-...@googlegroups.com
I haven't seen this discussed anywhere...

A lot of web apps (Drupal as an example in the CMS market) utilize cron jobs for system maintenance. Is something like this planned for J1.6? I've written several components that could really benefit from this for things like clearing out temporary data, flushing cache files, etc.

What I'd love to see is what ActiveCollab uses. There are 3 URLs that represent 15min, 1hour, and 1day maintenance scripts. Simple cronjobs schedule the firing of these scripts (usually by using CURL), and then plugins can hook into the maintenance scripts as necessary. The site admin can force the maintenance scripts to run by simply visiting the URLs (usually a button in admin interface makes this easy).

I think there is benefit to developers and site admins for doing cleanup this way. These kinds of scripts are often resource-heavy, and so should be handled on a periodic basis instead of ad-hoc triggers. Currently if you want maintenance functionality in a component, you either make it a manual administrator operation with a 'cleanup' button, or else (as in the case of Joomla's native caching) on every page load your component has to check whether it should run an operation based on time since last run, or other complicated data factors.

Scheduling also is more predictable. For example, imagine a component that automatically emails a site administrator a weekly report of activity, or a maintenance plugin that automatically archives articles over 1 year old. The possibilities are endless.

-Anthony


--
Anthony McLin
Senior Web Developer
amc...@kaadesigngroup.com
T 310.821.1400  F 310.821.1440

KAA Design Group, Inc.
4201 Redwood Avenue, Los Angeles, CA 90066
Architecture | Landscape | Brand Experience | Interiors
www.kaadesigngroup.com

Hannes Papenberg

unread,
Dec 18, 2009, 2:43:24 PM12/18/09
to joomla-...@googlegroups.com
Just a short note without having read it all, since I'm a bit in a
hurry: I've been planning a cron-like feature for Joomla for quite some
time and I will happily work on this when 1.6 is out the door. But
something like this will not be part of 1.6 for now.

Hannes

Anthony McLin schrieb:

> --
>
> You received this message because you are subscribed to the Google
> Groups "Joomla! CMS Development" group.
> To post to this group, send an email to joomla-...@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-cm...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-cms?hl=en-GB.

jiggliemon

unread,
Dec 19, 2009, 12:40:07 AM12/19/09
to Joomla! CMS Development
I think this would be a great plugin, possibly stock plugin. And there
no reason someone couldn't create such a plugin right now that does
exactly that.

Mark Dexter

unread,
Dec 19, 2009, 10:26:40 PM12/19/09
to joomla-...@googlegroups.com
I agree that doing this as an extension would be very valuable. I think if you did it now for 1.5 it would not be difficult to port to 1.6 and perhaps even get it into core at some point in the future. But having something like this for 1.5 would be totally awesome! Mark

klas berlič

unread,
Dec 25, 2009, 7:42:10 AM12/25/09
to joomla-...@googlegroups.com
The fastest way to get such functionality would be to create standalone script that does what you need and then run it when needed either via local or remote crontab. Put this http://docs.joomla.org/How_to_create_a_stand-alone_application_using_the_Joomla!_Framework  in the script and add necessary functions afterwards. E.g. to run cache cleanup you would just have to add something like this:

$cache = JFactory::getCache();
$cache->gc();

Or you can run specific group of plugins http://docs.joomla.org/Supporting_plugins_in_your_component


2009/12/20 Mark Dexter <dexter...@gmail.com>



--
------------------------------------------------------------------
http://www.bzzzz.biz  - Creating images
Marketing and web communication agency

http://www.belmondo.si - vacation packages,
travel, flight tickets & hotels

------------------------------------------------------------------

Mark Dexter

unread,
Dec 25, 2009, 1:26:09 PM12/25/09
to joomla-...@googlegroups.com
Hi Klas. This is great information to have. However, I still believe that it would be much easier for most users to have this capability built into Joomla! and accessible from the admin menu. Maybe someone could create an extension that uses the technique you outline but make it configurable from the Joomla! menus? Anyway, thanks for the great information. Mark

2009/12/25 klas berlič <klas....@gmail.com>

Anthony McLin

unread,
Dec 28, 2009, 2:37:40 PM12/28/09
to joomla-...@googlegroups.com
But then every component needs their own standalone script, and then their own crontab entries (some hosting providers that give cron functionality limit the number of entries you can setup). I was suggesting that Joomla have a global maintenance script (perhaps as a new plugin event) and then components can just hook into the plugin firing.
Reply all
Reply to author
Forward
0 new messages