Refer to the exhibit. Why does the cron job fail?
Trap 1: The cron job lacks the PATH environment variable.
The cron job specifies the full path to the script.
Trap 2: The script is owned by root, but the cron job runs as a different…
Cron runs as root, matching the owner.
Trap 3: The script lacks a shebang line.
A shebang is not required for cron if the script is executable.
- A
The cron job lacks the PATH environment variable.
Why it fails: The cron job specifies the full path to the script.
- B
The script is owned by root, but the cron job runs as a different user.
Why it fails: Cron runs as root, matching the owner.
- C
The script is not executable.
A non-executable script cannot be run directly by cron, which invokes the file itself rather than passing it to an interpreter. The missing execute permission bit therefore causes the job to fail, satisfying the stem's requirement that the script's file mode prevents execution.
- D
The script lacks a shebang line.
Why it fails: A shebang is not required for cron if the script is executable.