I am afraid that applescript was going to be my suggestion. Why won't it work from the prompt or more importantly when started by cron? I haven't done that often but it always worked for me...
Second, why can't you just push command-option-power/eject? This seems much easier than typing something into a command line...
Or are you using single-user mode or some such, and don't have access to normal OS X operations? Because I know there's a way to shut down your computer from the command line... hold on, lemme look it up... okay, I can't find it, but if you know much about UNIX you probably know what I'm talking about anyway. I'm sure you can do something for sleep from within UNIX.
hey, evrything else can be run from cron via a compiled script... You try it. Give me a logical explanation why an applescipt run from cron is different from running from it from the command prompt which is different from saving the script as an application then running it.
One guess did you use the full path to osascript in your cron job. It might not be in the path. There may also be some other issue of environment which you need to set right. Cron jobs tend to run in very spartin environments.
yeah the script will run but it ignores the sleep command, it will execute the whole script except for the sleep command and i always use full paths in my scripts /usr/bin/curl etc