.SH "DESCRIPTION"
\fBscrontab\fR is used to set, edit, and remove a user's Slurm-managed crontab.
This file can define a number of recurring batch jobs to run on a scheduled
interval.
.LP
Lines must be either comments starting with '#', whitespace, or valid crontab
entries.
.LP
Lines starting with \fB#SCRON\fR allow options to be defined for the single
following crontab entry. Options are always reset in between each crontab
entry. Options include most of those available to the \fBsbatch\fR command;
details are available in the \fBsbatch\fR(1) man page.
.LP
Note that jobs are not guaranteed to execute at the preferred time. Jobs will
run no more frequently than requested, but are managed by setting the
BeginTime field to the next valid iteration, and are then 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, if you
have a monitoring job that is 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.
.LP
\fBscrontab\fR uses the same syntax for date and time specifiers as \fBcron\fR.
Each line has five fields that have the following meanings:
.RS
field           allowed values
.br
-----           --------------
.br
minute          0-59
.br
hour            0-23
.br
day of month    1-31
.br
month           1-12 (or name)
.br
day of week     0-7 (0 and 7 are Sunday, or use name)
.RE

.LP
A field can contain an asterisk (*) which means that it's valid for each of
the allowed values for the given time period. Ranges are allowed where a range
is two numbers with a hyphen between them.  The second number must be greater
than the first. Lists are allowed, with commas separating the numbers or
ranges being separated. 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.

cancelled.

.TP
\fB\-u\fR <\fIuser\fR>
Edit or view a different user's crontab. Listing is permitted for Operators and
Admins. Editing/removal is only permitted for root and the \fISlurmUser\fR
account.

.SH "SCRONTAB OPTIONS"
\fBscrontab\fR allows you to use shortcuts to specify some common time
intervals for the specified script to run.  These include the following:
.TP
\fB@yearly\fR | \fB@annually\fR
Job will become eligible at \fI00:00 Jan 01\fR each year.

.TP
\fB@monthly\fR
Job will become eligible at \fI00:00\fR on the first day of each month.

.TP
\fB@weekly\fR
Job will become eligible at \fI00:00 Sunday\fR of each week.

.TP
\fB@daily\fR | \fB@midnight\fR
Job will become eligible at \fI00:00\fR each day.

.TP
\fB@hourly\fR
Job will become eligible at the first minute of each hour.

.SH "ENVIRONMENT VARIABLES"
.TP 20
\fBVISUAL\fR
Used as the interactive editor if set.

.TP
\fBEDITOR\fR
Used as the interfactive editor if set and \fBVISUAL\fR is not defined.

.TP
\fBSLURM_CONF\fR
The location of the Slurm configuration file.

.SH "NOTES"
\fBscrontab\fR is only available if the \fBScronParameters=enable\fR option has
been enabled in the \fBslurm.conf\fR.

.SH "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 \fBscrontab\fR:

.RS
.nf
1-5,30 8-17/2 * * wed /home/user1/example.job
.fi
.RE

.SH "COPYING"
Copyright (C) 2020 SchedMD LLC.
.LP
This file is part of Slurm, a resource management program.
For details, see <https://slurm.schedmd.com/>.
.LP
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.
.LP
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.

.SH "SEE ALSO"
.LP
\fBsbatch\fR(1), \fBsqueue\fR(1), \fBslurm.conf\fR(5)