Skip to main content

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

crc_prune_stale-0.2.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crc_prune_stale-0.2.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file crc_prune_stale-0.2.0.tar.gz.

File metadata

  • Download URL: crc_prune_stale-0.2.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for crc_prune_stale-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2d204073cfa6922f16158100a8b3e48713924dc5e20b91e5d3786e3fad4c3ade
MD5 7ac247d64b68706edafe90aa8ec14246
BLAKE2b-256 b69e483870d6a9c8aa741534e72a57e6e03c0af52f13f12d0c0694373a5e5d91

See more details on using hashes here.

File details

Details for the file crc_prune_stale-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for crc_prune_stale-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 038845942c8154aca237d51a43ae04725b0aca680fc7d35ef0d0d35067c6d739
MD5 6bf6dcf9bf0ac498136db7451dc45434
BLAKE2b-256 541cbb14c9497da5a7abb7ae3300b98a8b8da991821ed149adccd9754cf054ed

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

This release

0.2.0 This release

2 files

0.1.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page