scrontab(1)
π scrontab(1) β Slurm Commands π
okay bestie, gather round, because this is the manual page for scrontab, straight out of the Slurm Commands section. it's giving "cron but make it Slurm," and honestly? iconic. let's get into it π
β¨ NAME β¨
scrontab β manage Slurm crontab files ποΈ
β¨ SYNOPSIS β¨
scrontab [-u user] file
scrontab [-u user] [ -e | -l | -r ]
β¨ DESCRIPTION β¨
so like, scrontab is the whole vibe for setting, editing, and removing a user's Slurm-managed crontab π
. this file can define a bunch of recurring batch jobs that run on a scheduled interval. set it and forget it, fr fr.
every line in that file has to be one of these:
- a comment starting with
# - whitespace (yes, blank lines are valid, we love a breather)
- a valid crontab entry
- a custom variable setting
lines that start with #SCRON let you define options for the single following crontab entry β¨. options are always reset in between each crontab entry (so no, they don't carry over, don't even try it). these options include most of the ones available to the sbatch command β full deets live in the sbatch(1) man page.
π¨ real talk bestie: jobs are not guaranteed to execute at the preferred time. jobs will run no more frequently than requested, but they're managed by setting the BeginTime field to the next valid iteration, and then they're subject to queuing delays. the exact behavior will depend on the local site configuration.
because of this method of implementation, the next job in the series won't be submitted until after the previous job has completed π. for example: say you've got a monitoring job scheduled to run every minute on a busy system. if the job scheduled to start at 08:20:00 isn't able to start until 08:20:30 and it runs for 35 seconds, then the job at 08:21:00 will be skipped, and the next job will be scheduled for 08:22:00. no cap, that's just how it works.
scrontab uses the same syntax for date and time specifiers as cron. each line has five fields, and here's what they mean:
minuteβ allowed values0-59hourβ allowed values0-23day of monthβ allowed values1-31monthβ allowed values1-12(or name)day of weekβ allowed values0-7(0 and 7 are Sunday, or use name)
a field can contain an asterisk (*) which means that it's valid for each of the allowed values for that time period. ranges are allowed β a range is two numbers with a hyphen between them, and the second number must be greater than the first. lists are allowed too, with commas separating the numbers or ranges. step values can be specified by entering a slash (/) followed by the step value, causing the job to run at the specified interval appropriate for that field. slay.
custom variables can be defined as within a regular shell script πΈ. the $ character introduces variable expansion. simple parameter expansion is the only currently accepted expansion variant (i.e. ${parameter} or ${parameter:-word} are not supported). the variable expansion will only occur within scrontab job commands. it is not possible to expand variables in other type of lines (other variable definitions, comments or crontab entries). the expansion will happen before submitting the job, but the variable definitions will remain in the scrontab script. and unlike crontab, the user environment variables are ignored π.
β¨ OPTIONS β¨
the first form of this command is used to install a new crontab from some named file, or from standard input if the pseudo-filename - is given.
-eβ edit the crontab. if a crontab does not exist already, a default example (without any defined entries) will be provided in the editor π-lβ list the crontab. (prints directly tostdout.)-rβ remove the crontab. any currently running crontab-defined jobs will continue to run but will no longer recur. all other crontab-defined jobs will be cancelled β οΈ-u <user>β edit or view a different user's crontab. listing is permitted for Operators and Admins. editing/removal is only permitted forrootand theSlurmUseraccount. π
β¨ SCRONTAB OPTIONS β¨
scrontab lets you use shortcuts to specify some common time intervals for the specified script to run π. these include the following:
@yearly|@annuallyβ job will become eligible at00:00Jan 01 each year.@monthlyβ job will become eligible at00:00on the first day of each month.@weeklyβ job will become eligible at00:00Sunday of each week.@daily|@midnightβ job will become eligible at00:00each day.@hourlyβ job will become eligible at the first minute of each hour.@elevensesβ job will become eligible at11:00each day. (this is a non-standard extension.) π«@fikaβ job will become eligible at15:00each day. (this is a non-standard extension.) β@teatimeβ job will become eligible at16:00each day. (this is a non-standard extension.) π΅
β¨ ENVIRONMENT VARIABLES β¨
VISUALβ used as the interactive editor if set.EDITORβ used as the interactive editor if set andVISUALis not defined.SLURM_CONFβ the location of the Slurm configuration file.SLURM_DEBUG_FLAGSβ specify debug flags forscrontabto use. seeDebugFlagsin theslurm.conf(5)man page for a full list of flags. the environment variable takes precedence over the setting in theslurm.conf.
β¨ NOTES β¨
scrontabis only available if theScronParameters=enableoption has been enabled in theslurm.confπscrontabwill create a temporary file in the directory set by theTMPDIRenvironment variable. if the variable is not set,/tmpis used.- jobs created with
scrontabare assigned a single job id. when cancelled, all future runs of the job will also be cancelled. the job definition will be commented out in the user'sscrontabfile. - using
scontrol requeue <job_id>will skip the next run of the cron job and reschedule it for the next available time based on the cron expression π
β¨ EXAMPLES β¨
to create a job that would run at the beginning of each hour, using the 'high' partition, 'sub1' account and have a walltime of 1 minute, you would add the following to scrontab:
DIR=/home/user1
#SCRON -p high
#SCRON -A sub1
#SCRON -t 1:00
@hourly $DIR/date.printer.job
to have a job run every Wednesday, every other hour during the work day, each of the first five minutes of the hour and again at the thirty minute mark, you would add the following to scrontab:
1-5,30 8-17/2 * * wed $DIR/example.job
β¨ LIMITATIONS β¨
the Slurm controller's timezone is what will be used to evaluate each crontab's repetition intervals π. user-specific timezones are not supported.
β¨ COPYING β¨
Copyright (C) 2020-2022 SchedMD LLC.
this file is part of Slurm, a resource management program. for details, see <https://slurm.schedmd.com/>.
Slurm is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Slurm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details. π
β¨ SEE ALSO β¨
sbatch(1), squeue(1), slurm.conf(5)
and that's the whole page bestie!! π«Ά this was Slurm 26.05, hanging out in the Slurm Commands corner of the manual. go schedule something cute. periodt π β¨π
π¦ where this page comes from
- arch rolling: slurm-llnl 26.05.5.1-1 Β· GPL-2.0-or-later
- epel 10: slurm 26.05.5-1.el10_3 Β· GPL-2.0-or-later AND BSD-2-Clause AND BSD-1-Clause
- nixpkgs unstable: slurm 26-05-5-1
- ubuntu stonking: slurm-client 26.05.4-1ubuntu1 Β· GPL-2.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms