# Install lockrun with Homebrew, apk

Run cron jobs with overrun protection. Version 1.1.3 via Homebrew; verified 2026-05-19.

## Install

```sh
sudo av install brew:lockrun
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install lockrun
```

  Evidence: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add lockrun
```

  Evidence: Alpine Linux edge package indexes: lockrun from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

## Package facts

- **Package key:** brew:lockrun
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/lockrun>
- **Version:** 1.1.3
- **Source summary:** Run cron jobs with overrun protection
- **Homepage:** <http://unixwiz.net/tools/lockrun.html>
- **Upstream docs:** <http://unixwiz.net/tools/lockrun.html>
- **License:** LicenseRef-Homebrew-public-domain
- **Source archive:** <http://unixwiz.net/tools/lockrun.c>
- **Last updated:** 2026-05-19T13:03:29-04:00
- **Generated:** 2026-07-08T07:18:31+00:00

## Executables

- lockrun (cli)
- lockrun (alias)

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_big_sur, arm64_linux, arm64_monterey, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, big_sur, catalina, monterey, sonoma, ventura

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 1.1.3
- Package-manager updated: 2026-05-19
- Local data: ok
- Upstream repository: http://unixwiz.net/tools/lockrun.html
- info: Release/tag comparison is only available for GitHub repositories.
## Project history and usage

lockrun is a small public-domain Unix utility by Steve Friedl for running cron jobs with overrun protection. It wraps a command, takes an advisory file lock, and prevents overlapping invocations from piling up.

### Project history

The official Unixwiz.net page explains that lockrun was created in response to network-monitoring cron jobs that could run longer than their schedule interval. The tool was designed as a protective wrapper that checks whether another protected instance is already running before launching the requested command.

lockrun is distributed as portable C source code rather than through a hosted source repository. The official page documents building it with `gcc lockrun.c -o lockrun` and installing it into `/usr/local/bin`.

### Adoption history

The tool's natural audience is Unix administrators with cron jobs that must not overlap, especially polling and monitoring jobs. It was tested on FreeBSD and Linux, received a report of working on Mac OS X, and later gained portability work such as Solaris `lockf()` support.

Homebrew and Alpine packaging made the small C utility easier to install without manually downloading and compiling the source file.

### How it is used

A typical crontab entry invokes `lockrun --lockfile=/var/run/name.lockrun -- command`. If the lock cannot be acquired, lockrun exits instead of launching a second copy; `--wait`, `--quiet`, `--verbose`, and `--maxtime` adjust behavior.

The official documentation warns that the lockfile should be placed in a directory protected from other users and not in `/tmp`, because a writable directory could enable symlink attacks against the lockfile path.

### Why package nerds care

lockrun is package-manager-relevant because it solves a narrow operations problem with one C file and no daemon. It overlaps with `flock(1)` patterns, but its documented cron-oriented interface made it a remembered admin tool.

Its packaging story is also a reminder that not every useful Unix package has a modern VCS repository; sometimes the authoritative upstream is a source file and a carefully written HTML manual.

### Timeline

- 2006: Initial lockrun release.
- 2009: Solaris 10 `lockf()` support was added.
- 2010: `--quiet` parameter was added.
- 2012: Documentation about no kill option, `--retries`, and `setsid()` support were added.

### Related projects

- flock(1), run-one, and daemon supervisors solve adjacent locking or single-instance execution problems.
- Cacti poller scripts are used in the official documentation as a motivating cron example.

### Sources

- <http://unixwiz.net/tools/>
- <http://unixwiz.net/tools/lockrun.html>


## Security Notes

narrow executable package without higher-risk signals.

- **Geiger risk:** green / low
- narrow executable package without higher-risk signals

## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** lockrun
- **Version Scheme:** 0
- **Revision:** 0
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** yes
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## Other Package-Manager Records

- apk - lockrun - 1.1.3-r1: normalized package name match | Alpine Linux edge package indexes: lockrun from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Run cron job with overrun protection | http://unixwiz.net/tools/lockrun.html


## Related links

- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Networking and protocol packages](https://www.automicvault.com/pkg/networking-protocol-tools/) - Matched network, protocol, or remote-service metadata.
- [Web development packages](https://www.automicvault.com/pkg/web-dev-tools/) - Matched web development metadata.
- [Homebrew utility packages](https://www.automicvault.com/pkg/brew-utility-packages/) - Matched Homebrew package provider.
- [daemon](https://www.automicvault.com/pkg/brew/daemon/) - Shares av.db curated category or tags: cli, process-management, system, unix.
- [daemonize](https://www.automicvault.com/pkg/brew/daemonize/) - Shares av.db curated category or tags: cli, process-management, system, unix.
- [supervisor](https://www.automicvault.com/pkg/brew/supervisor/) - Shares av.db curated category or tags: cli, process-management, system, unix.
- [cpulimit](https://www.automicvault.com/pkg/brew/cpulimit/) - Shares av.db curated category or tags: cli, process-management, system.
- [detach](https://www.automicvault.com/pkg/brew/detach/) - Shares av.db curated category or tags: cli, process-management, system, unix.
- [gruyere](https://www.automicvault.com/pkg/brew/gruyere/) - Shares av.db curated category or tags: cli, process-management, system.
- [immortal](https://www.automicvault.com/pkg/brew/immortal/) - Shares av.db curated category or tags: cli, process-management, system, unix.
- [killport](https://www.automicvault.com/pkg/brew/killport/) - Shares av.db curated category or tags: cli, process-management, system.

## Combined YAML source

View the package source record on GitHub. [combined/lockrun.yml](https://github.com/automic-vault/db/blob/main/combined/lockrun.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
