Beaglebone crontab running python script to power down via shutdown

I am attempting to bring the Beaglebone down cleanly in the event of a power outage, to do this I am monitoring the AC input in a python script which when the AC power is lost calls a shutdown. If I call this from the cli with no AC but with USB the system shuts down correctly.
If I call this from a cron job the python script executes but the shutdown does not happen. I try to redirect any output to a file but no output is seen, I do see the file update time change each time the cron job fires but as before no shutdown

Any ideas ?

this happened to me, shutdown is actually a call to busybox define on /sbin/ and those not work on cron. You have to call the real command which is ‘busybox shutdown’(not sure i dont have th BB with me right now), you call see the command doing ‘ls -l /sbin/’.

Hope this helps

Pedro

Sorry for the delay…were you able to run the shutdown. I am trying to automate the shut down in my application but, “shutdown” need to be run from root.