getRecentJobs

Syntax

getRecentJobs(n)

Details

Retrieves the status of most recent n jobs on the local node, including scheduled jobs and batch jobs.

For details please refer to Batch Job Management.

Parameters

n is a positive integer. If it is unspecified, return all jobs since the session is started.

Returns

It returns a table with the following columns:

Name Meaning
node the alias of the local node
userID the user ID
jobId the job ID
rootJobId the root job ID
jobDesc the job description
priority priority of the job which is marked as integers ranging from 0 to 9
parallelism the parallelism, i.e., the maximum number of jobs that can run in parallel
clientIp the IP address of the client where the job is submitted
clientPort the port number of the client where the job is submitted
receivedTime the time (of TIMESTAMP type) when a job is received by the node
startTime the start time of jobs (of TIMESTAMP type)
endTime the end time of jobs (of TIMESTAMP type)
errorMessage error messages

Examples

def jobDemo(n){
   s = 0
   for (x in 1 : n) {
       s += sum(sin rand(1.0, 100000000)-0.5)
       print("iteration " + x + " " + s)
   }
   return s
};

submitJob("jobDemo1","job demo", jobDemo, 100);
submitJob("jobDemo2",, jobDemo, 10);

// Schedule a function to run periodically
def f():1+2;
scheduleJob(jobId=`daily, jobDesc="Daily Job 1", jobFunc=f, scheduleTime=10:22m, startDate=2026.06.16, endDate=2026.06.30, frequency='D');

// Retrieve the status of the 10 most recent jobs
getRecentJobs(10);
node userID jobId rootJobId jobDesc priority parallelism clientIp clientPort receivedTime startTime endTime errorMsg
local11454 admin jobDemo1 463f12b1-9530-caa9-f246-5934582eaa24 job demo 4 2 192.168.1.193 63,309 2026.06.16 10:21:01.875 2026.06.16 10:21:01.875 2026.06.16 10:22:05.678
local11454 admin jobDemo2 b119031d-4d47-3190-e846-f4db8c2a6e35 jobDemo 4 2 192.168.1.193 63,309 2026.06.16 10:21:01.875 2026.06.16 10:21:01.875 2026.06.16 10:21:08.127
local11454 admin daily 75311d80-f938-dc9f-5547-778a5c4ff136 Daily Job 1 4 2 0 2026.06.16 10:22:12.342 2026.06.16 10:22:12.342 2026.06.16 10:22:12.342