'Linux/Ubuntu Shell Script SLURM command

is it possible to execute the SLURM Commands such as srun or sacct inside a bash shell file( e.g. file.sh).

file.sh

#!/bin/bash

sacct --user enter image description here

I am getting an error such that :

Slurm - sacct: error: slurm_persist_conn_open_without_init: failed to open persistent connection to host:localhost:6819: Connection refused



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source