Search code examples
joomlascheduled-taskscron-task

joomla scheduled task run every second


how can I set a scheduled task that run every second on Joomla website?

I saw different extensions but they make only every minute, like minimum threshold. Any idea?


Solution

  • If you do this with a plain extension you need enough traffic to trigger the task every second. Even then this would be unreliable. The best way to do this is using a CRON job directly on your web server. This CRON job can call a CLI script or a URL on your server.

    https://en.wikipedia.org/wiki/Cron

    Here are some useful pages to generate the necessary task entry:

    https://crontab.guru/

    http://crontab-generator.org/

    If you want to run it every second you might want to check this:

    Running a cron every 30 seconds

    There are funny solution like using sleep to increase the cron time resolution. In addition there is a tiny script in one of the answers which might help as well.