NAME

whilejobs - Repeat a command while a job is running

VERSION

version 0.15.0

SYNOPSIS

whilejobs [options] "command"

DESCRIPTION

This script repeatedly executes a command while a specific SLURM job is running. It's useful for monitoring job progress, checking output files, or performing maintenance tasks that should continue until a job completes.

The script will: 1. Check if the specified job is still running 2. Execute the provided command 3. Wait for the specified interval 4. Repeat until the job finishes

OPTIONS

-i, --id <jobid>

Specify the SLURM job ID to monitor. This option is required.

-t, --time <time>

Specify the interval between checks. The default is 30 seconds. Format: number followed by unit (s=seconds, m=minutes, h=hours, d=days) Examples: "10s", "5m", "2h", "1d"

-u, --user <username>

Specify the username to check jobs for. By default, uses the current user.

--verbose

Display verbose output, including job status and command results.

--debug

Enable debug mode with detailed diagnostic information.

--version

Display version information and exit.

--help

Display this help message and exit.

EXAMPLES

Monitor job output:
whilejobs -i 12345 "tail -n 10 /scratch/job_output.log"
Check disk usage every 5 minutes:
whilejobs -i 67890 -t 5m "df -h /scratch"
Monitor another user's job:
whilejobs -i 54321 -u otheruser "ls -la /shared/results/"

AUTHOR

Andrea Telatin <proch@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2023-2025 by Andrea Telatin.

This is free software, licensed under:

The MIT (X11) License