Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#304175 - 20/11/2007 20:00 Forcing a shutdown in OSX
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3996
Loc: Manchester UK
So I've written a great little script that makes a set of symlinks that point to specific folders depending upon the day. This runs off a cron tab on an OSX server at 10 past midnight every night. The folder containing these symlinks is shared over NFS to a bunch of other macs. The problem I have is that although the symlinks update, you can see that in a terminal window, the little alias folders in Finder don't. It seems only a disconnect and reconnect to the share or a restart updates the alias folders.

So my question, is there any way to force a shutdown of a machine regards of anything running on it? The lusers are too stupid to remember to shut them down each night.
_________________________
Cheers,

Andy M

Top
#304176 - 20/11/2007 20:03 Re: Forcing a shutdown in OSX [Re: andym]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Make this Applescript script:

Code:
ignoring application responses
tell application "Finder"
shutdown
end tell
end ignoring


And then run it from cron using the "open" command.
_________________________
Bitt Faulk

Top
#304177 - 20/11/2007 20:19 Re: Forcing a shutdown in OSX [Re: wfaulk]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3996
Loc: Manchester UK
shutdown needed to be changed to shut down. But the apps still sit there asking for confirmation to quit.
_________________________
Cheers,

Andy M

Top
#304178 - 20/11/2007 20:43 Re: Forcing a shutdown in OSX [Re: andym]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Hmm. That's what the "ignoring" is supposed to avoid, obviously.

I assume you've tried the shutdown or reboot command.

How about "System Events" instead of "Finder"?


Edited by wfaulk (20/11/2007 20:46)
_________________________
Bitt Faulk

Top
#304179 - 21/11/2007 04:05 Re: Forcing a shutdown in OSX [Re: andym]
drakino
carpal tunnel

Registered: 08/06/1999
Posts: 7868
Terminal command "shutdown -h now" to shutdown or "shutdown -r now" for a restart. No GUI confirmations so unsaved work will be lost. But to OS X, it is a proper shutdown, just like any other Unix OS.

Top
#304180 - 21/11/2007 19:26 Re: Forcing a shutdown in OSX [Re: drakino]
andym
carpal tunnel

Registered: 17/01/2002
Posts: 3996
Loc: Manchester UK
Quote:
Terminal command "shutdown -h now" to shutdown or "shutdown -r now" for a restart. No GUI confirmations so unsaved work will be lost. But to OS X, it is a proper shutdown, just like any other Unix OS.


That did it, stuck it in root's crontab and prefixed it with /sbin/

Now all the machines power off at 5 to midnight every night
_________________________
Cheers,

Andy M

Top