New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

A question of pmset


Post Reply New Thread Subscribe

 
Thread Tools
pmposse

 
Member Since: Oct 23, 2012
Posts: 2
pmposse is on a distinguished road

pmposse is offline
Hi,

Firstly, great forum and I hope you guys can help!

I have several suites of macs running at a college. I want to shutdown all the macs at night as the students tend to leave them running. So far I have used the following command in terminal;

Code:
pmset repeat shutdown MTWRF 21:00:00
So, at 9pm each weeknight the macs will shutdown, fine. The problem however is that they tend to leave software running which then halts the shutdown, is there any way to force the macs to kill all the running software through pmset or should I be doing this another way?

I'm happy for anything open to be lost as basically they should have saved it.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,991
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
I wonder if cron might be a better solution here. I only suggest this since, with cron, you could use the shutdown tool to halt the machine which, at least in Linux (so I imagine it's the same in OS X), is ruthless and waits for nothing to close. Are you familiar with cron?

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
docx

 
docx's Avatar
 
Member Since: Apr 30, 2012
Location: Wales, UK
Posts: 335
docx has a spectacular aura about
Mac Specs: I Mac 27-inch 2.7 GHz Intel Core i5 12GB ram. MacBook Pro 13-inch 2.5GHz dual-core Intel i5 4GB ram

docx is offline
Why don't you schedule them to shut down at a certain time.
Preferences>Energy Saver >Schedule.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,991
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
Haha, this might have been an instance of over thinking this on my part. That should work as well.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
pmposse

 
Member Since: Oct 23, 2012
Posts: 2
pmposse is on a distinguished road

pmposse is offline
Cheers for your fast responses!

Docx, the problem with the energy saver is that it basically calls pmset so still will not shutdown if any software is running. The reason I used the terminal command is that it does not appear in the energy saver control panel so can't be altered by users!

Vansmith, I have not used cron at all but Ill have a look at it, cheers.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,991
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
Take a look at cron. I use it to run a few things on a schedule and it works really well. With cron, you can also (as noted) use the shutdown tool to halt the machine which won't care if something is running (which appears to be what you want to accomplish).

Here's a nice cron tutorial on the Ubuntu wiki.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
Mark FX

 
Mark FX's Avatar
 
Member Since: Aug 13, 2011
Location: West Sussex, UK
Posts: 168
Mark FX has a spectacular aura about

Mark FX is offline
You could also build a stay open Applescript application, that runs in the background, and checks the
current system time every few minutes, and then closes all running apps when 9pm roles around,

I'm no Applescript expert, but I could post some code if your interested in that kind of solution.

Regards Mark
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,991
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
The only problem with an AppleScript solution is the ease with which it can be stopped. Any student at a machine could stop/quit an AS, thus precluding the shutdown process from ever happening.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
Mark FX

 
Mark FX's Avatar
 
Member Since: Aug 13, 2011
Location: West Sussex, UK
Posts: 168
Mark FX has a spectacular aura about

Mark FX is offline
Good Point.
QUOTE Thanks
Mark FX

 
Mark FX's Avatar
 
Member Since: Aug 13, 2011
Location: West Sussex, UK
Posts: 168
Mark FX has a spectacular aura about

Mark FX is offline
Yes that is a possible problem, but I would have the app well hidden in a location that only
a system admin could access, and have it set up to start automatically when the computer starts.

But point taken, just an alternative though.

Mark
QUOTE Thanks

Post Reply New Thread Subscribe


« Characters not displayed correctly in Terminal on Mountain Lion | email extractor »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
The QUESTION Game ToddG Schweb's Lounge 159 08-15-2007 05:25 PM
Boot-Up Question Mark Folder Impending Doom Question. bingwalker OS X - Operating System 3 07-10-2007 05:19 AM
Ask 'me' a question... eric Schweb's Lounge 22 01-12-2007 06:33 AM
Video production question macinsandiego Movies and Video 4 11-17-2004 07:39 AM
Postscript question battleangel444 OS X - Operating System 2 07-09-2004 12:45 PM

All times are GMT -4. The time now is 01:01 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?