1scrontab(1) Slurm Commands scrontab(1)
2
3
4
6 scrontab - manage Slurm crontab files
7
8
10 scrontab [-u user] [ -e | -l | -r ]
11
12
14 scrontab is used to set, edit, and remove a user's Slurm-managed
15 crontab. This file can define a number of recurring batch jobs to run
16 on a scheduled interval.
17
18 Lines must be either comments starting with '#', whitespace, or valid
19 crontab entries.
20
21 Lines starting with #SCRON allow options to be defined for the single
22 following crontab entry. Options are always reset in between each
23 crontab entry. Options include most of those available to the sbatch
24 command; details are available in the sbatch(1) man page.
25
26 Note that jobs are not guaranteed to execute at the preferred time.
27 Jobs will run no more frequently than requested, but are managed by
28 setting the BeginTime field to the next valid iteration, and are then
29 subject to queuing delays. The exact behavior will depend on the local
30 site configuration. Because of this method of implementation, the next
31 job in the series won't be submitted until after the previous job has
32 completed. For example, if you have a monitoring job that is scheduled
33 to run every minute on a busy system, if the job scheduled to start at
34 08:20:00 isn't able to start until 08:20:30 and it runs for 35 seconds
35 then the job at 08:21:00 will be skipped and the next job will be
36 scheduled for 08:22:00.
37
38 scrontab uses the same syntax for date and time specifiers as cron.
39 Each line has five fields that have the following meanings:
40 field allowed values
41 ----- --------------
42 minute 0-59
43 hour 0-23
44 day of month 1-31
45 month 1-12 (or name)
46 day of week 0-7 (0 and 7 are Sunday, or use name)
47
48
49 A field can contain an asterisk (*) which means that it's valid for
50 each of the allowed values for the given time period. Ranges are al‐
51 lowed where a range is two numbers with a hyphen between them. The
52 second number must be greater than the first. Lists are allowed, with
53 commas separating the numbers or ranges being separated. Step values
54 can be specified by entering a slash (/), followed by the step value,
55 causing the job to run at the specified interval appropriate for that
56 field.
57
58
60 -e Edit the crontab. If a crontab does not exist already, a default
61 example (without any defined entries) will be provided in the
62 editor.
63
64
65 -l List the crontab. (Prints directly to stdout.)
66
67
68 -r Remove the crontab. Any currently running crontab-defined jobs
69 will continue to run but will no longer recur. All other
70 crontab-defined jobs will be cancelled.
71
72
73 -u <user>
74 Edit or view a different user's crontab. Listing is permitted
75 for Operators and Admins. Editing/removal is only permitted for
76 root and the SlurmUser account.
77
78
80 scrontab allows you to use shortcuts to specify some common time inter‐
81 vals for the specified script to run. These include the following:
82
83 @yearly | @annually
84 Job will become eligible at 00:00 Jan 01 each year.
85
86
87 @monthly
88 Job will become eligible at 00:00 on the first day of each
89 month.
90
91
92 @weekly
93 Job will become eligible at 00:00 Sunday of each week.
94
95
96 @daily | @midnight
97 Job will become eligible at 00:00 each day.
98
99
100 @hourly
101 Job will become eligible at the first minute of each hour.
102
103
105 VISUAL Used as the interactive editor if set.
106
107
108 EDITOR Used as the interfactive editor if set and VISUAL
109 is not defined.
110
111
112 SLURM_CONF The location of the Slurm configuration file.
113
114
116 scrontab is only available if the ScronParameters=enable option has
117 been enabled in the slurm.conf.
118
119
121 To create a job that would run at the beginning of each hour, using the
122 'high' partition, 'sub1' account and have a walltime of 1 minute, you
123 would add the following to scrontab:
124
125 #SCRON -p high
126 #SCRON -A sub1
127 #SCRON -t 1:00
128 @hourly /home/user1/date.printer.job
129
130
131 To have a job run every Wednesday, every other hour during the work
132 day, each of the first five minutes of the hour and again at the thirty
133 minute mark, you would add the following to scrontab.
134
135 1-5,30 8-17/2 * * wed /home/user1/example.job
136
137
139 Copyright (C) 2020 SchedMD LLC.
140
141 This file is part of Slurm, a resource management program. For de‐
142 tails, see <https://slurm.schedmd.com/>.
143
144 Slurm is free software; you can redistribute it and/or modify it under
145 the terms of the GNU General Public License as published by the Free
146 Software Foundation; either version 2 of the License, or (at your op‐
147 tion) any later version.
148
149 Slurm is distributed in the hope that it will be useful, but WITHOUT
150 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
151 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
152 for more details.
153
154
156 sbatch(1), squeue(1), slurm.conf(5)
157
158
159
160April 2021 Slurm Commands scrontab(1)