2

From the sacct man page:

 --name:
               Display jobs that have any of these name(s).
         Use this comma separated list of uids or user names

When I provide full job's name following command works sacct --name [job_name]

$ sacct --name QmRsaBEGcqxQcJbBxCi1LN9iz5bDAGDWR6Hx7ZvWqgqmdR*1*0*-1.sh
       JobID    JobName  Partition    Account  AllocCPUS      State ExitCode
------------ ---------- ---------- ---------- ---------- ---------- --------
43           QmRsaBEGc+      debug      alper          2    TIMEOUT      1:0
43.batch          batch                 alper          2  CANCELLED     0:15

For example, now I want to retrive it by providing the begining of the name such as Qm*. But I obtain an empty string. It sees * as a character.

sacct --name Qm*
       JobID    JobName  Partition    Account  AllocCPUS      State ExitCode
------------ ---------- ---------- ---------- ---------- ---------- --------

[Q] Is it possible to I use sacct --name by providing only the beginning of the job's name? If yes, how?

alper
  • 2,919
  • 9
  • 53
  • 102

1 Answers1

2

--name option does not support wildcard patterns. One way to achieve the result you are looking for is to use grep command :

# list all the jobs from January 2018 and filter it leaving those that contain Qm:
sacct --format=jobid,jobname,ntasks,elapsed,state -S 010118 -u username |grep Qm
Katia
  • 3,784
  • 1
  • 14
  • 27
  • Is it inefficient to list complete job list and grep from? If I do not know the start time of the job, what is best approach to state the date to read from? @Katia – alper May 20 '18 at 05:59
  • 1
    @alper Well, if you narrow down your search only to a particular use or a group of users this should be fast enough. As for the date, you do not need to specify the date, but if you work on a very large cluster, the more you can narrow down the search - the better. So I would estimate the date as best as you can. You do not need to be precise. Just a rough estimate. – Katia May 20 '18 at 13:05
  • I realized still this does not returns the complete job name. It returns as follows: `QmRsaBEGc+` and remaining part is ignored. @Katia – alper Sep 10 '18 at 12:16