parseCrontab (lib/scheduled-os-schedule.mjs)

career-ops · web/src/lib/scheduled-os-schedule.mjs · javascript · MIT
automation, tag:knn-classified

Pure status helpers for the macOS (launchd) and Linux (cron) scan schedule. The install scripts write CRON_MARKER on the crontab line they own.

// Source: https://github.com/career-ops-hq/career-ops | License: MIT | Copyright 2026 Santiago Fernández de Valderrama
// Provided via justclaw.it.com; keep this notice with the code.
// Pure status helpers for the macOS (launchd) and Linux (cron) scan schedule.
// The install scripts write CRON_MARKER on the crontab line they own.
export const CRON_MARKER = "# career-ops recurring scan";

const EMPTY_TASK = { exists: false, enabled: false, status: null, nextRun: null, lastRun: null };

export function parseCrontab(text) {
  const line = String(text).split("\n").map((l) => l.trimEnd()).find((l) => l.endsWith(CRON_MARKER));
  if (line === undefined) return { exists: false, enabled: false };
  return { exists: true, enabled: !line.trimStart().startsWith("#") };
}

export function parseLaunc

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key