User Tools

Site Tools


ubuntu:cron:schedule_a_cron_job_to_run_on_every_30_seconds

Ubuntu - Cron - Schedule a Cron Job to Run on Every 30 Seconds

It is not possible to specify a cron job to run in every 30 seconds or so using the time field parameter of the crontab.

However, we can still do this using the following entries.

* * * * * /scripts/script.sh
* * * * * sleep 30; /scripts/script.sh

There are actually two different entries needed for this purpose.

The first crontab entry tells cron to run the script at every minute.

And the second entry makes cron run the next one after a 30-second pause.

ubuntu/cron/schedule_a_cron_job_to_run_on_every_30_seconds.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki