Bug Description
The cron script field supports a path that includes arguments (e.g. memory-ttl.py expire), but _run_job_script() in cron/scheduler.py treats the entire string as a filename rather than parsing it into "script path + arguments".
Steps to Reproduce
- Create a cron job with
script: "memory-ttl.py expire" (or any script that accepts CLI arguments)
- Run the cron job
- Observe that
subprocess.run([sys.executable, str(path)]) receives the full string as the path argument — the script runs but without expire as an argument, so it executes in its default mode instead
Expected Behavior
Use shlex.split() to separate the script filename from its arguments, then append the arguments to the subprocess call: subprocess.run([sys.executable, str(path)] + script_args).
Actual Behavior
The entire string including whitespace-separated arguments is treated as a single filename. Scripts that rely on CLI arguments silently run in the wrong mode.
Impact
Any cron job using a script that requires arguments (like --report-only, expire, --check-only) silently runs with the wrong behavior. The job still returns ok status, masking the incorrect execution.
Bug Description
The cron
scriptfield supports a path that includes arguments (e.g.memory-ttl.py expire), but_run_job_script()incron/scheduler.pytreats the entire string as a filename rather than parsing it into "script path + arguments".Steps to Reproduce
script: "memory-ttl.py expire"(or any script that accepts CLI arguments)subprocess.run([sys.executable, str(path)])receives the full string as the path argument — the script runs but withoutexpireas an argument, so it executes in its default mode insteadExpected Behavior
Use
shlex.split()to separate the script filename from its arguments, then append the arguments to the subprocess call:subprocess.run([sys.executable, str(path)] + script_args).Actual Behavior
The entire string including whitespace-separated arguments is treated as a single filename. Scripts that rely on CLI arguments silently run in the wrong mode.
Impact
Any cron job using a script that requires arguments (like
--report-only,expire,--check-only) silently runs with the wrong behavior. The job still returns ok status, masking the incorrect execution.