That would do it. I feel like I knew this at one point, but I don't use it enough to have it stick. Thanks!The PATH variable is different when running under cron, to when running in the shell.
From a root shell prompt it isfrom a root cron job it isCode:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binSolutions to this are to add the full PATH to your crontab, add it to your cron script, or use the full pathname of the command "/usr/sbin/shutdown". I prefer the full pathname as that ensures it uses the correct command and not an alternative from, say, /usr/local/bin.Code:
PATH=/usr/bin:/bin
-
Nice! Thank you! Downloaded, read, and filed. Maybe I'll find it again later???
-
It does everything else, and it writes a logfile, so clearly it's running...Do you have not by chance forgotten to make your script executable ?
Statistics: Posted by AaronD — Thu Aug 14, 2025 6:03 pm