[slurm-users] How to print a user's creation timestamp from the Slurm database?

Ole Holm Nielsen Ole.H.Nielsen at fysik.dtu.dk
Mon Jan 20 10:29:23 UTC 2020

Hi Jürgen,

On 1/19/20 2:38 PM, Juergen Salk wrote:
> * Ole Holm Nielsen <Ole.H.Nielsen at fysik.dtu.dk> [200118 12:06]:
>> When we have created a new Slurm user with "sacctmgr create user name=xxx",
>> I would like inquire at a later date about the timestamp for the user
>> creation.  As far as I can tell, the sacctmgr command cannot show such
>> timestamps.
> Hi Ole,
> for me (currently running Slurm version 19.05.2) the command
>   sacctmgr list transactions Action="Add Users"
> also shows timestamps. Isn't this what you are looking for?

This is indeed a hidden feature of Slurm!  The sacctmgr man-page has a 
single example:

sacctmgr list transactions StartTime=11/03\-10:30:00 

This example is actually incorrect: StartTime should be Start and the 
backslash \ should be removed.  Here is a correct example:

sacctmgr list transactions Action="Add Users" Start=01/01 format=where,time

This "sacctmgr list transactions" feature should be usable for my task at 
hand.  If you want to know which users were added within the last 30 days, 
you "just" have to calculate the appropriate Start time = (Now - 30 days) 
for the above command.

One caveat is that users may have been added and then removed, but one can 
list removed users by:

sacctmgr list transactions Action="Remove Users" Start=01/01 format=where,time

There is a different way reading the entire list of users directly from 
the Slurm database with a mysql command, and I will post this method in a 
separate mail.


More information about the slurm-users mailing list