I have an Oozie job, which I can see using the oozie jobs -filter command :
oozie jobs -filter name="SparkMyJobCoordinator" -jobtype coord
That returns :
#bla bla bla oozie config
Job ID App Name Status Freq Unit Started Next Materialized
------------------------------------------------------------------------------------------------------------------------------------
0001951-180518111214886-oozie-oozi-C SparkMyJobCoordinatorRUNNING 1 DAY 2018-05-29 01:00 GMT 2018-05-30 01:00 GMT
------------------------------------------------------------------------------------------------------------------------------------
However I do not see this job when trying to print all my jobs. I see some jobs, including one supposed to launch a Hive command, but not the "Spark" one.
oozie jobs -oozie http://localhost:11000/oozie -jobtype coord
That returns:
#bla bla bla oozie onfig
#bla bla bla some other jobs
Job ID App Name Status Freq Unit Started Next Materialized
------------------------------------------------------------------------------------------------------------------------------------
0002106-180518111214886-oozie-oozi-C HiveMyJobCoordinatorRUNNING 1 DAY 2018-05-30 01:00 GMT 2018-05-31 01:00 GMT
------------------------------------------------------------------------------------------------------------------------------------
#bla bla bla some other jobs
The only difference that I see between these two jobs are that this one is in a WAITING state. Why is this job not listed in the last command?
Related
I am trying to export the Task Scheduler jobs under Task Scheduler Library using Power shell.
But when i try to run the script it displays all the tasks which are in my machine, i don't want to export all those to a file,just need the tasks which are under Task Scheduler Library.
"ScheduledTasks"
schtasks.exe /query /V /FO CSV | ConvertFrom-Csv
Output
HostName : XXXXXXXXX
TaskName : \Mozilla\Firefox Default Browser Agent
308046B0AF4A39CB
Next Run Time : 25-06-2021 18:03:40
Status : Ready
Logon Mode : Interactive only
Last Run Time : 24-06-2021 18:03:41
Last Result : 0
Author : Mozilla
Task To Run : C:\Program Files\Mozilla
Firefox\default-browser-agent.exe
do-task 308046B0AF4A39CB""
Start In : N/A
Comment : The Default Browser Agent task checks
when the default changes from Firefox
to another browser. If the change
happens under suspicious circumstances,
it will prompt users to change back to
Firefox no more than two times. This
task is installed automatic
Scheduled Task State : Enabled
Idle Time : Disabled
Power Management :
Run As User : XXXX
Delete Task If Not Rescheduled : Disabled
Stop Task If Runs X Hours and X Mins : 00:35:00
Schedule : Scheduling data is not available in
this format.
Schedule Type : Daily
Start Time : 18:03:40
Start Date : 21-06-2021
End Date : N/A
Days : Every 1 day(s)
Months : N/A
Repeat: Every : Disabled
Repeat: Until: Time : Disabled
Repeat: Until: Duration : Disabled
Repeat: Stop If Still Running : Disabled
Thanks In Advance
I am trying to look for cron expression to schedule a job every alternate Mondays at 12 PM. I am using Rundeck to schedule my jobs.
How do i create an expression that runs a job like this ?
1st Run => 01-July-2019 [Monday] 12:00 PM
2nd Run => 15-July-2019 [Monday] 12:00 PM
3rd Run => 29-July-2019 [Monday] 12:00 PM
You need another "verifier" job (using Rundeck API) that modifies the first at every alternate, here you have a good example: https://github.com/G3NSVRV/Rundeck-Scripts/tree/master/ProjectExamples/ConditionalCron (take a look from line 39 to 50 in "Cron.xml" file).
Im having some difficulty with this cron job. Running a job at 6:15PM every otherTuesday during March, June, September and December
What I have so far 15 18 1 3,6,9,12 2
Have a cron schedule for every Tuesday, and then make sure in the command that it only runs every other time. For example, we can use the date command to get the number of the week, so we can check if that week number is even.
15 18 * 3,6,9,12 2 [ $((`date +%V`%2)) -eq 0 ] && your_command
(untested)
I know, there are many contents about cronjob. But i'm uncertain.
I need a Cron that run all 5 minutes. This Cron shouldn't run between 00:00 and 01:00 (in the night)
My cron
*/5 01-23 * * * balbalabalabal > aaa
Is this right?
Running this cron at 23.05, 23.10....23.55 and start again at 01:00?
best regards!
Ok I tested this.
The Cron runs at 23.05, 23.10..... until 23.55.
Then pausing and the first Cronjob start again at 01.00
Yesterday I kicked off an oozie workflow. It started two jobs that stalled all day. I killed them this morning, having made a change that I now want to test. After killing the two jobs it's like the workflow became unstuck and is now proceeding. I would like to kill the workflow so it doesn't keep starting new jobs to replace the ones I kill. How can I do that in the oozie command line?
Oozie commands
--------------
Note: Replace oozie server and port, with your cluster-specific.
1) Submit job:
$ oozie job -oozie http://localhost:11000/oozie -config oozieProject/workflowHdfsAndEmailActions/job.properties -submit job: 0000001-130712212133144-oozie-oozi-W
2) Run job:
$ oozie job -oozie http://localhost:11000/oozie -start 0000001-130712212133144-oozie-oozi-W
3) Check the status:
$ oozie job -oozie http://localhost:11000/oozie -info 0000001-130712212133144-oozie-oozi-W
4) Suspend workflow:
$ oozie job -oozie http://localhost:11000/oozie -suspend 0000001-130712212133144-oozie-oozi-W
5) Resume workflow:
$ oozie job -oozie http://localhost:11000/oozie -resume 0000001-130712212133144-oozie-oozi-W
6) Re-run workflow:
$ oozie job -oozie http://localhost:11000/oozie -config oozieProject/workflowHdfsAndEmailActions/job.properties -rerun 0000001-130712212133144-oozie-oozi-W
7) Should you need to kill the job:
$ oozie job -oozie http://localhost:11000/oozie -kill 0000001-130712212133144-oozie-oozi-W
8) View server logs:
$ oozie job -oozie http://localhost:11000/oozie -logs 0000001-130712212133144-oozie-oozi-W
Logs are available at:
/var/log/oozie on the Oozie server.
You can view your running jobs with:
oozie jobs
or if it's a coordinator, not a workflow:
oozie jobs -jobtype coordinator
And get the Job ID from there, then do:
oozie job -kill [id]
Here's the command line tool reference page: http://incubator.apache.org/oozie/docs/3.1.3/docs/DG_CommandLineTool.html
In addition to the post related to Oozie commands, sometimes we don't have to access to the respective workflow id to suspend/kill etc. and we get below error:
Error: E0508 : E0508: User [?] not authorized for WF job [0001304-190209190348229-oozie-mapr-W]
For this, to perform any operation like kill/suspend etc. we need to generate the authenticating token for our user id. For this, first, we need to clear the existing tokens from the file using below command and then perform suspend/kill etc. action on given workflow id:
rm .oozie-auth-token
From Apache Oozie docs:
Once authentication is performed successfully the received
authentication token is cached in the user home directory in the
.oozie-auth-token file with owner-only permissions. Subsequent
requests reuse the cached token while valid.
For more details, the link of Apache Oozie docs (refer Authentication section):
Official Documentation
I think you will find it helpful how to kill, rerun, etc multiple (example 200) jobs at the same time using bash.
In one single line:
$for jobid in `oozie jobs -filter status=SUSPENDED | cut -d" " -f1`; do echo "Killed job ${jobid}"; job -kill ${jobid}; done