What am I misunderstanding about how sacct filtering works here? I would have expected the second command to show the exact same results as the first.
[root@mickey ddrucker]# sacct --starttime $(date -d "7 days ago" +"%Y-%m-%d") -X --format JobID,JobName,State,Elapsed --name zsh JobID JobName State Elapsed ------------ ---------- ---------- ---------- 257713 zsh COMPLETED 00:01:02 257714 zsh COMPLETED 00:04:01 257715 zsh COMPLETED 00:03:01 257716 zsh COMPLETED 00:03:01
[root@mickey ddrucker]# sacct --starttime $(date -d "7 days ago" +"%Y-%m-%d") -X --format JobID,JobName,State,Elapsed --name zsh --state COMPLETED JobID JobName State Elapsed ------------ ---------- ---------- ----------
[root@mickey ddrucker]# sinfo --version slurm 21.08.8-2
-- Daniel M. Drucker, Ph.D. Director of IT, MGB Imaging at Belmont McLean Hospital, a Harvard Medical School Affiliate
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline https://www.massgeneralbrigham.org/complianceline . Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
All I can say is that this has to do with --starttime and that you have to read the manual really carefully about how they interact, including when you have --endtime set. It’s a bit fiddly and annoying, IMO, and I can never quite remember how it works.
-- #BlackLivesMatter ____ || \UTGERS, |---------------------------*O*--------------------------- ||_// the State | Ryan Novosielski - novosirj@rutgers.edu || \ University | Sr. Technologist - 973/972.0922 (2x0922) ~*~ RBHS Campus || \ of NJ | Office of Advanced Research Computing - MSB A555B, Newark `'
On Jan 10, 2024, at 19:39, Drucker, Daniel DDRUCKER@MCLEAN.HARVARD.EDU wrote:
What am I misunderstanding about how sacct filtering works here? I would have expected the second command to show the exact same results as the first.
[root@mickey ddrucker]# sacct --starttime $(date -d "7 days ago" +"%Y-%m-%d") -X --format JobID,JobName,State,Elapsed --name zsh JobID JobName State Elapsed ------------ ---------- ---------- ---------- 257713 zsh COMPLETED 00:01:02 257714 zsh COMPLETED 00:04:01 257715 zsh COMPLETED 00:03:01 257716 zsh COMPLETED 00:03:01
[root@mickey ddrucker]# sacct --starttime $(date -d "7 days ago" +"%Y-%m-%d") -X --format JobID,JobName,State,Elapsed --name zsh --state COMPLETED JobID JobName State Elapsed ------------ ---------- ---------- ----------
[root@mickey ddrucker]# sinfo --version slurm 21.08.8-2
-- Daniel M. Drucker, Ph.D. Director of IT, MGB Imaging at Belmont McLean Hospital, a Harvard Medical School Affiliate
The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://www.massgeneralbrigham.org/complianceline .
Please note that this e-mail is not secure (encrypted). If you do not wish to continue communication over unencrypted e-mail, please notify the sender of this message immediately. Continuing to send or respond to e-mail after receiving this message means you understand and accept this risk and wish to continue to communicate over unencrypted e-mail.
On 1/10/24 19:39, Drucker, Daniel wrote:
What am I misunderstanding about how sacct filtering works here? I would have expected the second command to show the exact same results as the first.
You need to specify --end NOW for this to work as expected. From the man page:
WITHOUT --jobs AND WITH --state specified: --starttime defaults to Now. --endtime defaults to --starttime and to Now if --starttime is not specified.
Eg
sacct --starttime $(date -d "7 days ago" +"%Y-%m-%d") -X --format
JobID,JobName,State,Elapsed --name bash JobID JobName State Elapsed ------------ ---------- ---------- ---------- 570741 bash COMPLETED 00:00:02 570742 bash COMPLETED 00:00:02 570743 bash FAILED 00:00:01 570744 bash FAILED 00:00:01 570745 bash FAILED 00:00:01 570746 bash COMPLETED 00:00:02 570747 bash COMPLETED 00:00:02 570748 bash COMPLETED 00:00:02
sacct --starttime $(date -d "7 days ago" +"%Y-%m-%d") -X --format
JobID,JobName,State,Elapsed --name bash --state COMPLETED JobID JobName State Elapsed ------------ ---------- ---------- ----------
sacct --starttime $(date -d "7 days ago" +"%Y-%m-%d") -X --format
JobID,JobName,State,Elapsed --name bash --state COMPLETED --end now JobID JobName State Elapsed ------------ ---------- ---------- ---------- 570741 bash COMPLETED 00:00:02 570742 bash COMPLETED 00:00:02 570746 bash COMPLETED 00:00:02 570747 bash COMPLETED 00:00:02 570748 bash COMPLETED 00:00:02
Hope this helps! Chris