Is there a way to start a cron job manually

0 votes

Suppose, a job is scheduled to start in 12 hours, but I want to trigger it manually once now without changing the cron schedule. Is this possible?

Sep 18, 2018 in Kubernetes by lina
• 8,100 points
237 views

2 answers to this question.

Your answer

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

If your Cron job is a Linux Shell Script with the ".sh" extension, you could do the following:
 

[root@localhost ~]# sh /etc/cron.daily/your_script.sh
answered Sep 18, 2018 by Kalgi
• 36,220 points
0 votes

You can create a simple job based on your ScheduledJob. If you already run a ScheduledJob, there are jobs in history.

kubectl get jobs

NAME               DESIRED   SUCCESSFUL   AGE
hello-1477281595   1         1            11m
hello-1553106750   1         1            12m
hello-1553237822   1         1            9m

Export one of these jobs:

kubectl get job hello-1477281595 -o yaml > my_job.yaml

Then edit the yaml a little bit, erasing some unnecessary fields and run it manually:

kubectl create -f my_job.yaml
kubectl delete -f my_job.yaml
answered Sep 18, 2018 by Nilesh
• 6,900 points

Related Questions In Kubernetes

0 votes
1 answer

Run a cron job once in N hours

If you want your cron job to ...READ MORE

answered Sep 18, 2018 in Kubernetes by Kalgi
• 36,220 points
21 views
0 votes
1 answer

Do not wantthe cron job to restart with failure

you have to set a backoffLimit: 0 in combination ...READ MORE

answered Sep 18, 2018 in Kubernetes by Kalgi
• 36,220 points
76 views
0 votes
1 answer
0 votes
1 answer

Is it possible to access GCP resources using api without a user interaction.?

yes that's totally possible. You'd have to create ...READ MORE

answered Sep 19, 2018 in Kubernetes by Kalgi
• 36,220 points
23 views
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
683 views
+3 votes
1 answer
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
• 36,220 points
61 views
0 votes
1 answer

Connect to existing pod, execute script, disconnect - Kubernetes cron job

As far as i know there's no ...READ MORE

answered Sep 17, 2018 in Kubernetes by Kalgi
• 36,220 points
379 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.