Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to retrieve the content of slurm script?

I submitted a job several days ago, and it is still running now. But I forget the content of that script.sh that day. And the script.sh has been deleted. Do you know how to recover the content of that script?

like image 643
Jingnan Jia Avatar asked Sep 17 '25 04:09

Jingnan Jia


1 Answers

With recent versions, you can retrieve the job script for your own jobs with

scontrol write batch_script <job_id> <optional_filename>

From the man page:

Write the batch script for a given job_id to a file or to stdout. The file will default to slurm-<job_id>.sh if the optional filename argument is not given. The script will be written to stdout if - is given instead of a filename. The batch script can only be retrieved by an admin or operator, or by the owner of the job.

On older versions, the write batch_script command does not exist, but you can get the script with

scontrol show -ddd job <job_id>
like image 66
damienfrancois Avatar answered Sep 18 '25 16:09

damienfrancois