I'm working with SLURM v21.08 and I was looking to clean from some very old data the slurm_acct_db (mysql).
This DB become huge and I was looking to use sacctmgr, but I do not have a clear and safe solution yet. Is there any easy command or way to clean it from some data older than a specific date?
Thank you
I'm working with SLURM v21.08 and I was looking to clean from some very old data the slurm_acct_db (mysql).
This DB become huge and I was looking to use sacctmgr, but I do not have a clear and safe solution yet. Is there any easy command or way to clean it from some data older than a specific date?
Thank you
Share Improve this question edited yesterday Shadow 34.3k10 gold badges65 silver badges75 bronze badges asked yesterday Emma AthanEmma Athan 5491 gold badge6 silver badges16 bronze badges1 Answer
Reset to default 0As you mentioned, you can use sacctmgr
can be used to delete the old records. You can use where clause to perform it. This can be seen from the documentation,
delete <ENTITY> where <SPECS>
Delete the specified entities. Identical to the remove command.
For example, to delete jobs that ended before January 1, 2020, you can run:
sacctmgr delete job where endtime < '2020-01-01'
It is very important that you backup your slurm_acct_db
first and test it maybe in a safe environment first (copy and try the command out in a non-production environment first).
NB: Depending on your SLURM configuration and version, you might need to also clean up related tables (such as job_steps or user associations). SLURM’s documentation and your accounting schema can provide guidance on this.
Alternatively (non direct approach) is to create a new database with only recent data and use it instead of the big old data.