pidlock

package
v2.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndCreatePidFile

func CheckAndCreatePidFile(backupName string, command string) error

func ExtractBackupNameFromCommand added in v2.7.0

func ExtractBackupNameFromCommand(command string) string

ExtractBackupNameFromCommand parses a backup_actions command string (e.g. `upload --resumable=1 my_backup`, `delete local my_backup`, `restore_remote --rm my_backup`) and returns the backup name (last positional token), or empty string if the command does not target a single backup (watch, clean, list, kill, ...).

func IsRunning added in v2.8.1

func IsRunning(backupName string) bool

IsRunning reports whether the pid file of backupName points to a live process, used to skip cleanup of shadow freezes which belong to a parallel or the current operation

func RemovePidFile

func RemovePidFile(backupName string)

func RemovePidFileForCommand added in v2.7.0

func RemovePidFileForCommand(command string)

RemovePidFileForCommand extracts the backup name from a backup_actions command string and removes the corresponding pid file, if any. Safe to call for commands that don't have a pid file (no-op).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL