Slurm Job Pruning
A maintenance tool for canceling stale jobs on Slurm clusters.
A command-line utility for Slurm administrators that identifies and cancels jobs which have been stuck in the PENDING state for longer than a configurable threshold. Affected users are notified by email, with all of their canceled jobs batched into a single message, and a dry-run mode is provided for previewing changes before applying them.
Install and Setup
Install the utility from the CRCD Python repository using pipx:
pipx install crc-prune-stale
Confirm the prune-stale utility is available in your runtime environment:
prune-stale --help
Optionally, create the application log directory to enable persistent file logging. If the directory is not present, the application will fall back to console-only logging:
sudo mkdir -p /var/log/prune_stale
Usage
prune-stale [OPTIONS]
Pruning options
| Option | Default | Description |
|---|---|---|
--threshold DAYS |
10 |
Days a job must have been pending before cancellation |
--dry-run |
off | Log which jobs would be cancelled without taking any action |
Notification options
| Option | Default | Description |
|---|---|---|
--smtp-host HOST |
— | SMTP relay hostname. Omit to disable email notifications |
--smtp-port PORT |
25 |
SMTP relay port |
--email-from ADDRESS |
slurm-noreply@pitt.edu |
Sender address for notification emails |
--email-dmn DOMAIN |
pitt.edu |
Domain appended to usernames to form recipient addresses |
Pass --help to see all options with their current defaults.
Examples
Cancel all jobs that have been pending for more than 10 days (no email notification):
prune-stale --threshold 10
Cancel jobs and issue an email notification to the job submitter:
prune-stale --threshold 10 --smtp-host mailrelay.pitt.edu
Preview what would be canceled without making any changes:
prune-stale --dry-run
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file crc_prune_stale-0.1.3.tar.gz.
File metadata
- Download URL: crc_prune_stale-0.1.3.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
364d1bb066864c418a94dea2ee51a2d87d2407d5cf6601d7f74a492a7289298c
|
|
| MD5 |
e6cdd8ec9efe9a50c647edc32ac41be4
|
|
| BLAKE2b-256 |
0c0f31192adb325109f5ea0d72ae11a7a866ba849099f3519fd8b878c2928a7d
|
File details
Details for the file crc_prune_stale-0.1.3-py3-none-any.whl.
File metadata
- Download URL: crc_prune_stale-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6815b5bbec9209b5a2b55e79067eaae9b345449d5693a1c6229acd6ca6173db3
|
|
| MD5 |
3f11206c314f3ba92b5723e965409a13
|
|
| BLAKE2b-256 |
57338264ddf6ee8388a6b68bc5d4b21780444d84340e94405f1cf720ca386826
|