Recurring Jobs (scrontab)
Exercises¶
- Create a scrontab entry that runs every hour
Use scrontab -e to add an entry that runs a simple script every hour. The script should append the current date and hostname to a log file. Set resource limits of 10 minutes and 1G memory.
Hint / Solution
First create the script: Then edit your scrontab with `scrontab -e` and add: Use absolute paths for all files in scrontab entries.- List your scrontab entries
After creating an entry, verify it was saved by listing your scrontab. Also use squeue to find the associated job ID that Slurm created for your recurring job.
Hint / Solution
- Remove a scrontab entry
Remove all your scrontab entries using scrontab -r. Verify the removal by listing again and checking that the associated job is no longer in the queue.