Create External Sentinel File with Input Tracking

create_external_sentinel(sentinel_path, input_files, metadata = list())

Arguments

sentinel_path

Path to sentinel file, either relative to project root or absolute

input_files

Character vector of input file paths, either relative to project root or absolute

metadata

Optional list of additional metadata to store

Details

Tracks external dependencies (HPC jobs, shell scripts, database exports, etc.) using sentinel files. All paths are resolved relative to the project root using `here::here()`. Absolute paths are automatically converted to relative paths for storage, ensuring sentinels work consistently across platforms (Windows/Linux/Mac) and different working directories.

All timestamps are stored in UTC to ensure consistency when sentinels are shared across machines in different timezones (e.g., Sydney to Brisbane, or across international systems).

Examples of valid calls: - Relative paths: `create_external_sentinel(".external/job.json", c("data/raw.csv", "params.json"))` - Absolute paths: `create_external_sentinel("/full/path/.external/job.json", c("/full/path/data/raw.csv"))` - Mixed: `create_external_sentinel("./external/job.json", "/full/path/data/raw.csv")`

Creates a JSON sentinel file that records: - Completion timestamp (UTC) - Input files (stored as relative paths) and their modification times (UTC) - Optional custom metadata

Examples

if (FALSE) { # \dontrun{
# Using relative paths (recommended)
create_external_sentinel(
  sentinel_path = ".external/job_complete.json",
  input_files = c("data/raw.csv", "params.json"),
  metadata = list(job_id = "12345", nodes = 4)
)
} # }