Scheduled tasks (cron): Difference between revisions
Jump to navigation
Jump to search
No edit summary |
IA migration §8: rewrite around scrontab (SLURM cron); discourage login-node crontab; fix crontab -l/-e bug (via update-page on MediaWiki MCP Server) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
Recurring, scheduled tasks on Anunna should be run through the scheduler with '''scrontab''', SLURM's built-in cron. scrontab uses the familiar crontab syntax, but runs each scheduled task as a SLURM job on a compute node — so your recurring work gets proper resources and does not load the shared login nodes. | |||
{{Warning|Do not use a plain login-node <code>crontab</code> for recurring work. Anything scheduled with <code>crontab</code> runs on the login node, which is a shared access point not meant for computation, and the crontab is wiped when the login node reboots. Use <code>scrontab</code> instead.}} | |||
== Using scrontab == | |||
Edit your scrontab with: | |||
<syntaxhighlight lang="bash"> | |||
scrontab -e | |||
</syntaxhighlight> | |||
Each entry has two parts: one or more <code>#SCRON</code> lines that set the SLURM options for the job (partition, time limit, resources, job name, …), followed by a normal crontab time specification and the command to run. | |||
The crontab | |||
<syntaxhighlight lang="bash"> | |||
#SCRON --partition=main | |||
#SCRON --time=00:10:00 | |||
#SCRON --job-name=daily-download | |||
0 2 * * * /home/<group>/<username>/scripts/download.sh | |||
</syntaxhighlight> | |||
This runs <code>download.sh</code> as a SLURM job every day at 02:00. List your current entries with: | |||
<syntaxhighlight lang="bash"> | |||
scrontab -l | |||
</syntaxhighlight> | |||
The crontab time format (the <code>0 2 * * *</code> part) is described in the crontab manual page: | |||
<syntaxhighlight lang="bash"> | |||
man 5 crontab | |||
</syntaxhighlight> | |||
== See also == | |||
* [[Batch Jobs]] | |||
* [[Scheduler Overview (Slurm)]] | |||
Latest revision as of 12:58, 18 June 2026
Recurring, scheduled tasks on Anunna should be run through the scheduler with scrontab, SLURM's built-in cron. scrontab uses the familiar crontab syntax, but runs each scheduled task as a SLURM job on a compute node — so your recurring work gets proper resources and does not load the shared login nodes.
⚠️ Warning: Do not use a plain login-nodecrontabfor recurring work. Anything scheduled withcrontabruns on the login node, which is a shared access point not meant for computation, and the crontab is wiped when the login node reboots. Usescrontabinstead.
Using scrontab
Edit your scrontab with:
scrontab -e
Each entry has two parts: one or more #SCRON lines that set the SLURM options for the job (partition, time limit, resources, job name, …), followed by a normal crontab time specification and the command to run.
#SCRON --partition=main
#SCRON --time=00:10:00
#SCRON --job-name=daily-download
0 2 * * * /home/<group>/<username>/scripts/download.sh
This runs download.sh as a SLURM job every day at 02:00. List your current entries with:
scrontab -l
The crontab time format (the 0 2 * * * part) is described in the crontab manual page:
man 5 crontab