Run a cron job once in N hours

0 votes
Kubernetes cron job has a feature where it can run a job a specified time.

I'm trying to have something where you can run a job every N hours. But i can't find any example or documentation to do so.

How do I go about this?
Sep 18, 2018 in Kubernetes by lina
• 8,100 points
27 views

1 answer to this question.

0 votes

If you want your cron job to run every hour then you can do something like this:

You have to edit the crontab file, like:

crontab -e

There you add

0 13,14,15 *   *   *     /home/user/command

to execute your command at 13:00, 14:00 and 15:00. Also note that user has to be substituted with the user account the command is executed in.

answered Sep 18, 2018 by Kalgi
• 37,320 points

Related Questions In Kubernetes

0 votes
1 answer

How to fail a (cron) job after a certain number of retries?

You're trying to set 3 asbackoffLimit of your Job. ...READ MORE

answered Sep 17, 2018 in Kubernetes by Kalgi
• 37,320 points
76 views
0 votes
2 answers

Is there a way to start a cron job manually

You can create a simple job based ...READ MORE

answered Sep 18, 2018 in Kubernetes by Nilesh
• 6,900 points
317 views
0 votes
1 answer
+1 vote
4 answers
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
1,117 views
+3 votes
1 answer
0 votes
1 answer

Kubernetes cron job call curl in loop

It's a small silly mistake: dollar sign $ should be ...READ MORE

answered Sep 17, 2018 in Kubernetes by Kalgi
• 37,320 points
722 views