How to setup CRON job to run every 10 seconds in Linux

0 votes

I need to run a CRON job every 10 seconds from started time.

In Linux how to run a CRON job on every 10 seconds from the time its started?

I am trying to solve that as following: when I make a request (or start) at 04:28:34 it should start at 04:28:44 not at 4:28:40

This is what I have done

# m h  dom mon dow   command
*/10 * * * * /usr/bin/wget http://api.us/application/

What did I do wrong? Why does this not trigger wget every 10 seconds?

Apr 20, 2022 in Linux Administration by Edureka
• 13,690 points
• 6,933 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

I think you missed one more star to include seconds:

*/10 * * * * * /usr/bin/wget
answered Jul 8, 2022 by anonymous

edited Mar 5, 2025
0 votes
# m h  dom mon dow   command

Linux can run cron jobs only with a granularity of minutes. So one of the solutions is to run a job, that creates a sub-process in the background every 10 seconds in an infinite loop, and check every minute using cron, if this main tasks is still running / spawn a new loop.
answered Dec 5, 2022 by Filip

edited Mar 5, 2025

Related Questions In Linux Administration