[slurm-users] Finding submitted job script

Jessica Nettelblad jessica.nettelblad at gmail.com
Tue Jul 10 11:05:07 MDT 2018


Since 17.11, there's a command to write the job script to a file:
"scontrol write batch_script job_id optional_filename
Write the batch script for a given job_id to a file. The file will default
to slurm-<job_id>.sh if the optional filename argument is not given. The
batch script can only be retrieved by an admin or operator, or by the owner
of the job."

In previous releases, we used scontrol show job -dd to get the job script.
But for security reasons, it's removed from 17.11:
https://github.com/SchedMD/slurm/commit/04bc96f66efb7f0aa61720eb5fdbb96b03f2c0ee#diff-3afa6e205164362d9d2daf2c167f0962
"User-submitted batch scripts cannot be safely escaped. This functionality
will be replaced with a way to retrieve the script directly into a file
for a given jobid."

In the master branch, scontrol write batch_script also has the option to
write the job script to STDOUT instead of a file. This is what we use in
the prolog when we gather information for later (possible) troubleshooting.
So I suppose that'll be available from 18.08 without patching.
https://github.com/SchedMD/slurm/commit/158551a7059702ba46eaab78168008fe75d1c070#diff-bc42eb80c8e7b0e26af71e04acab6aca

Best regards,
Jessica Nettelblad, UPPMAX

On Tue, Jul 10, 2018 at 6:16 PM, Shenglong Wang <sw77 at nyu.edu> wrote:

> scontrol show job -dd JOBID
>
> then search
>
> Command=
>
> Best,
> Shenglong
>
> On Jul 10, 2018, at 12:02 PM, Mahmood Naderan <mahmood.nt at gmail.com>
> wrote:
>
> Hi
> How can I check the submitted script of a running based on its jobid?
>
>
> Regards,
> Mahmood
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20180710/8962507d/attachment.html>


More information about the slurm-users mailing list