Ravindra BagaleCourses & study guides

Chapter 17: Interview Questions and Job Readiness

17.4 Bash and automation

Q18. Why did a cron script fail though it worked interactively?

Different PATH, missing env vars, relative paths, or no TTY. Use absolute paths and log stdout/stderr from cron.

Q19. What is an exit code?

Process return status — 0 usually success; non-zero failure. Scripts should check curl / command results before restarting services.

Q20. Idempotent-ish script habit?

Check before change: "install only if missing," "restart only if health fails" — reduces surprise re-runs.