Cron Syntax: run cron job every 10 minutes except for 10th minute - cron

I am having troubles with cron syntax,
I want to run cron job every 10 minutes,but not on 10th minute.
it has to run on 20,30,40,50,00 of the hour, not on 10.
How I do this?
10-59/10 * * * * doesn't work.

Add all times when the Job should be executed
0,20,30,40,50 * * * *

Related

Run Cron Job every 5 minutes for 10 seconds

I have a script that I want to run every 5 minutes for 10 seconds.
*/5 * * * * /root/XXX/cronjobs/add-prod.sh
It seems logical to have another cron job that would run every 5 minutes and 10 seconds
that would turn off the 1st cron job.
Something like this:
[FORMULA HERE] /root/XXX/cronjobs/rem-prod.sh
How can we set a formula for "every 5 minutes and 10 seconds" ?
You can do this via timeout. It will kill the process after 10 seconds. It would be better than killing the process externally. Otherwise, jakob22's answer is the best one.
*/5 * * * * /usr/bin/timeout 10 /root/XXX/cronjobs/add-prod.sh
Edit: This is already featured in a comment.

How to run a cron job for every 2 minutes 30 seconds

30 */2 * * * *
this expression runs every 2 minutes starting form 30 seconds. Say for example I'm starting cron job at 5 Pm. cron job start executing at 5:00:30, 5:02:30, 5:04:30 in (HH:MM:Sec). But I need the solution to execute every 2 minutes 30 seconds. like 5:02:30, 5:05:00, 5:07:30 this.
cron only provides the ability to start jobs in minute intervals. However, you can call the sleep program to create a seconds-based offset. NOTE that this is not a high precision scheduling framework; depending on your system load some tasks might be delayed.
# run at minute 2, 7, 12, 17, … then offset by 30 seconds
2-57/5 * * * * sleep 30; your_command
# run at minute 0, 5, 10, 15, … without offset
*/5 * * * * your_command
Find a similar answer here, although the question is phrased a bit differently (execute every 30 seconds)

Airflow: Is there a way where I can trigger a job at 35th second, every minute using CRON expression?

I want to trigger a shell script at 35th second, every minute. However, I see that airflow supports CRON from the minute level instead of the second level.
For example, the cron Expression
35 * * * *
triggers a job at every 35th minute in airflow.
I'm not familiar with Airflow, but cron only supports 1-minute resolution.
You could use cron to invoke a job every minute and let the job sleep for 35 seconds:
* * * * * sleep 35 ; do_something

Run Cron Job On Specific Minute?

I need to run a cron job on the 3rd minute of every hour, every day.
Here's what I currently have:
3 * * * *
Is that how you correctly do it or would that run it every 3 minutes instead?
That is correct!
If you would like to run a job every third minute you could do like this:
*/3 * * * *

Cron trigger to run at half past the hour every hour

Can anyone suggest a way to set a Cron trigger to run at half past the hour every hour?
So far, I've got one working hourly as per "0 0/60 * * * ?".
Am I looking at "0 0/30 * * * ?" at all?
Mr Morgan.
I would use 30 * * * * to run a command half past every hour.
It is worth remembering that in crontab you define a pattern to match the current time against and not an exact time. Every minute crond will awaken and match the current time against your pattern and if there is a match, run your command.
I recommend using http://www.cronmaker.com/ for painless cron expressions.
Use this:
0 0/30 * * * ?
and not "30 * * * *" as this will trigger in every 30 seconds.
I know this was asked years ago but the correct cron syntax for half past trigger will be:
30 * 1/1 * ? *

Resources