deleteJobArtifacts

First introduced in version: 3.00.6

Syntax

deleteJobArtifacts(jobId)

Details

Deletes the files persisted on the local disk for a scheduled job or batch job, helping free up disk space.

This function deletes the following files associated with the specified job from the directory configured by the batchJobDir parameter:

  • jobId.msg: The message file generated during job execution.

  • jobId.obj: The object file storing the job return value.

After the file is deleted, the job's return object can no longer be retrieved with getJobReturn, and intermediate job messages are no longer available through getJobMessage. However, the job information can still be queried using getAllJobs.

Note:

  • Regular users can delete only the jobs they submitted. The admin user can delete jobs submitted by any user. The guest user is not permitted to call this function.

  • Jobs that are queued or currently running cannot be deleted. You must wait until the job has completed before calling this function.

Parameters

jobId is a STRING scalar specifying the ID of the job. jobId must not be empty, contain the path separator / or \, or be . or ...

Returns

None.

Examples

Example 1: Delete the persistent results of a completed job.
submitJob("job1", "", now)
getJobReturn("job1")
// output: 2026.06.11 17:11:35.060

deleteJobArtifacts("job1")

getJobReturn("job1")
// output: The object file for job [job1] doesn't exist on disk.
Example 2: Delete a nonexistent job.
deleteJobArtifacts("job3")
// output: The specified job [job3] does not exist.

Related functions: getAllJobs, scheduleJob, submitJob, submitJobEx, submitJobEx2