From 03e72b6a064eb3382c70aea63217eb69efe822b8 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Sun, 24 May 2026 18:11:50 -0400 Subject: [PATCH] fix(scheduler): use Unraid plugin cron mechanism instead of /etc/cron.d/varaverk dcron uses the filename in /etc/cron.d/ as the username, so a file named 'varaverk' ran jobs as a non-existent user and was silently ignored. Switch to writing /boot/config/plugins/varaverk/varaverk.cron and calling update_cron (which merges all plugin .cron files into /etc/cron.d/root). In dev mode (no varaverk.plg registered), fall back to injecting our entries directly into the live root crontab via crontab -c /etc/cron.d -. --- .../plugins/varaverk/include/scheduler.php | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php b/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php index 0ef9c76..a07951d 100644 --- a/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php +++ b/Plugin/usr/local/emhttp/plugins/varaverk/include/scheduler.php @@ -1,13 +1,12 @@ /dev/null') ?: ''; + $filtered = preg_replace('/^[^\n]*run_job\.sh[^\n]*\n?/m', '', $current); + $ours = file_get_contents(CRON_FILE); + $combined = rtrim($filtered) . "\n\n" . $ours . "\n"; + $tmp = tempnam('/tmp', 'varaverk_cron_'); + file_put_contents($tmp, $combined); + exec('crontab -c /etc/cron.d - < ' . escapeshellarg($tmp)); + unlink($tmp); + } return true; }