When I use the --state option (or -s) wit sacct I always get an empty list returned. For example
sacct --state=completed --format=User,JobID,Jobname%50,partition,state,time
or
sacct --state=canceled --format=User,JobID,Jobname%50,partition,state,time
both return empty list. The only exception is for pending tasks in which case I do get an non-empty list. sacct itself or used with the option --starttime does show tasks in all states. They just don't show up when using the --state filter even when I copy the status there.
What am I doing wrong? How do I get a list of all tasks in a certain state?
You have to specify the
--starttimeand--endtimeto see the jobs completed in a specific time duration. Otherwise the start and end time will be the current time when the --state option is specified and only currently running jobs can be displayed (Check here).For example,
The documentation states the following:
These are the job state codes:
Another example: to see jobs that completed, either normally or abnormally, since July 12th, without job steps:
Visit here for more information.