Hi Charles Correia
If I understood well you requirement, with ctmpsm will not be possible to filter with DATE RANGE.
You may be able to create a Viewpoint to match only the required jobs and as an Option, Use Reporting Facility.
Can you clarify you request?:
1) Do you need a list of jobs that are currently active and in "Executing" state "only" ? (your environment have jobs that execute more than X Days)
2) or jobs that are in Active List more than X Days from current Date? (your environment have jobs that were ordered in past X Days and for some reason they are still on Active job list)
Thanks for your reply
- Jobs that are currently in execution status only but have been executing for longer than 10 days
- Yes that can occur and we would like automated way to track these jobs without manually have to go through each job in execution status and verifying the order date of the job.
I am not quite sure of your solution. Can you provide more detail on your solution.
1 of 1 people found this helpful
A quick solution would be -
ctmpsm -LISTJOB EXECUTING | grep " 20190309 "
will show any job that is executing and has an ODATE of 9th March.
3 of 3 people found this helpful
Thanks for clarifying!
As I said before, ctmpsm will not allow you to filter the DATE Ranges. You can process/parse the ctmpsm output with and script and test the "ODATE".
If you have ability with scripting you can select only lines that match your needs.
What you can also do, is to filter the jobs with a Viewpoint "All Active Jobs" on CTMEM Client GUI, by selecting "Advanced Criteria" (CTRL+D) and ad the Date RANGE and Job Status.
You may want to Add the Start Time Filed to make sure you range is better defined.
If you want only the Jobs executing more than X days, set the second "Order Date" with one day range from your last x days period..
As for the Reporting facility your another request I am trying to generate a report in report facility that will display jobs in execution status that have been running longer then 10 days.
, you can do the same by filtering the jobs fields. I will post the solution ASAP.
as of my words ..,"with ctmpsm will not be possible to filter with DATE RANGE. " and " As I said before, ctmpsm will not allow you to filter the DATE Ranges. You can process/parse the ctmpsm output with and script and test the "ODATE"." in the reply to your question.
I have just found two ways to extract job list in executing state where the util returns a datetime range that can be parsed with a script to determine the number of days it is being executing :
1) with CTMAPI, if available in your environment:
a) ctm run jobs:status::get 10 -s "ctm=Distribuido,&status=Executing,&orderDateFrom=190310,&orderDateTo=1990321" [for version 184.108.40.206 and Higher]
b) ctm run jobs:status::get -s "ctm=Distribuido,&status=Executing" [for version 9.0.4 and Higher]
2) ctmpsm -LISTALL "TIME" -SORT "ORDERID" | grep "Executin"
With those commands, You can taylor a script and parse the diference between "now/current time" - minus "start time" like this : date -u -d @"startTime" +'%T'
hope that it helps you