If you are using the Cron Jobs feature from your hosting or your server crontab,
you can run cronjob every 10 seconds by setting up 6 cronjobs running every minute, the second one with a 10-second delay:
* * * * * curl https://example.com/cron.php * * * * * sleep 10 && curl https://example.com/cron.php * * * * * sleep 20 && curl https://example.com/cron.php * * * * * sleep 30 && curl https://example.com/cron.php * * * * * sleep 40 && curl https://example.com/cron.php * * * * * sleep 50 && curl https://example.com/cron.php
Now your cron.php will run every 10 seconds.
Alternatively, you can also create a cronjob which will run your task 6 times sequentially:
* * * * * /bin/bash -c 'for i in {1..6}; do curl https://example.com/cron.php; sleep 10; done'
However, it doesn't take into account your cronjob execution time.
FastCron is the best tool to run your cronjob every 10 seconds. You just need to create one cronjob, and you'll get:
Start 14-day free trial, no credit card required.
Need help? Reach out to support@fastcron.com - we're happy to help.
See why 8,000+ website developers and their teams use FastCron to run their cronjobs 12 million times a day.
The reliable online cronjob service for your websites since 2009.