Scrontab

Scrontab can be used to perform regularly recurring jobs, such as backing up files or retrieving system information.

Danger

As the best way to generate a random numbers is to let beginners use a vi-editor; so you may set the scrontab editor by setting to one youre familar with, example:

export EDITOR=$(which nano)

To edit your slurm cronjobs simply use:

scrontab

The options will exactly work like in sbatch.

Here is an brief example how this could look like:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
DIR=/home/95/bt123456 #(1)!
#SCRON -p dev
#SCRON -t 1:00
#SCRON -n 1 -N 1
#SCRON --mail-type=ALL --mail-user=bt123456@uni-bayreuth.de
@teatime squeue > $DIR/$(date +%s).txt #(3)!

### job 3
#SCRON -t 4:00
#SCRON --ntasks-per-node=1 --nodes=2
#SCRON --mail-type=ALL --mail-user=b123456@uni-bayreuth.de
05 14 * * thu hostname >> $DIR/hosts #(5)!
  1. Define a directory. Variables scope works same way as in a bash script.
  2. Every day at 16:00 run squeue and write it to a file named by unixtime.
  3. Every thursday at 13:55 let 2 nodes

When this file is saved now slurm will automaticaly queue the listed jobs.

[bt123456@festus01 hpcadmin]# squeue
     JOBID PARTITION      NAME       USER ST      TIME NODES NODELIST(REASON)
      7266       dev      squeue bt123456 PD      0:00 1 (BeginTime)
      7267    normal    hostname bt123456 PD      0:00 2 (BeginTime)