Job History¶
Let's submit a job again with sbatch and check on it with squeue.
Notice that the job disappeared from the output of squeue after completion. How can we check on jobs after they've disappeared here? If you know the job ID, you can always run jobinfo:
But how do we query the full job history?
We can use the sacct program to search deeper into our job history:
The sacct program is highly malleable, with many options for data filtering and output:
| Flag | Description | Example Usage |
|---|---|---|
-a |
Show jobs for all users (not just your own) | sacct -a |
-X |
Exclude job steps, show only top-level jobs | sacct -X |
-j |
Query specific job(s) by JobID | sacct -j 12345,12346 |
-u |
Filter by user | sacct -u jsmith |
-A |
Filter by account | sacct -A rcac-gpu |
-r |
Filter by partition | sacct -r gpu |
-S |
Start time (inclusive) | sacct -S 2026-01-01 or sacct -S now-30days |
-E |
End time (inclusive) | sacct -E 2026-01-31 |
-s |
Filter by job state | sacct -s COMPLETED,FAILED |
-o |
Select custom output fields | sacct -o JobID,User,State,Elapsed |
-T |
Show timestamps instead of elapsed durations | sacct -T |
-P |
Output pipe-delimited format (script-friendly) | sacct -P -n |
An example of a job search that is only for a specific username with a specific submission account over the past 15 days would be:
This shows you what jobs you have run with the lab_queue account.
Next section: Resource Utilization and Monitoring