🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Bash Scripting for DevOps: all 10 questions

Quiz: Bash Scripting for DevOps · Question 10 of 10

A cron job works when you run it by hand but does nothing from cron. What is a likely cause?

A cron job works when you run it by hand but does nothing from cron. What is a likely cause?

  1. A.cron cannot run bash scripts
  2. B.The script has a shebang line
  3. C.The machine has too much RAM
  4. D.cron uses a very small PATH, so commands without full paths are not found, and the error was not logged
Answer & explanation

Correct answer: cron uses a very small PATH, so commands without full paths are not found, and the error was not logged

Use full paths and redirect output with >> file.log 2>&1 to see what went wrong.

Can you get the rest right without peeking?

Take the timed Quiz: Bash Scripting for DevOps quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →