Home › Forums › OS X Server and Client Discussion › Misc. › energysaver prefs
- This topic has 5 replies, 4 voices, and was last updated 14 years, 12 months ago by
JamesSimon.
-
AuthorPosts
-
April 15, 2009 at 11:43 am #375996
[email protected]
ParticipantHi all,
nice challenge:
when a computer is in use (not at loginwindow) we don’t want it to go to sleep. when a computer is not in use (at loginwindow) we want it to go to sleep after 30 minutes.
this can easily be done using login- and logouthooks doing a pmset blabla command.extra challenge is that we want to wake all the computers at 06:00 AM. this can easily be done using MCX or placing the right com.apple.AutoWake.plist in /Library/Preferences/SystemConfiguration.
BUT
waking up several 100 computers at exactly the same moment can’t be good for our power infrastructure so i’m searching a solution to wake the computers at random between 06:00 AM and 06:05 AM.
any ideas?
May 15, 2009 at 11:18 pm #376189torona318
ParticipantThere are a couple of things you can do go stagger your wake up times. One is to create different computer groups and apply different MCX settings for wake times. The other is just to apply the MCX settings to a group of computers in the computer list like maybe 25 at a time.
-Thomas
June 15, 2009 at 8:23 pm #376448[email protected]
ParticipantHi all,
create different groups in directory infrastructure is not the way we want to go… there are enough groups to take care about 🙂i was more thinking about something like:
create a set of 10 autowake.plist files and store them somewhere on the system (i often use a folder /Library/Deployment/blabla)
so let’s create 10 different autowake files with 10 different wake times defined
/Library/Deployment/AutoWake/01.com.apple.autowake.plist
/Library/Deployment/AutoWake/02.com.apple.autowake.plist
…
create a startupitem or something else that does the jobgenerate number between 01 and 10 and name that number VARNR
cp /Library/Deployment/AutoWake/$VARNR.com.apple.autowake.plist /Library/Preferences/SystemConfiguration/com.apple.autowake.plistany thoughts on this?
any ideas how to generate a random number between 01 and 10 or between 0 and 9?June 16, 2009 at 6:55 pm #376457[email protected]
Participanthi all,
tnx for the input.
to wrap up:to disable sleep when a user is logged in, run following script as a loginhook
[code]
/usr/bin/pmset -c sleep 0
/usr/bin/pmset -c displaysleep 5
/usr/bin/pmset -c disksleep 0
/usr/bin/pmset -c lessbright 0
/usr/bin/pmset -c halfdim 0/usr/bin/pmset -b sleep 0
/usr/bin/pmset -b displaysleep 5
/usr/bin/pmset -b disksleep 5
/usr/bin/pmset -b lessbright 1
/usr/bin/pmset -b halfdim 1
[/code]to enable sleep when no user is logged in, run following script as a logouthook
[code]
/usr/bin/pmset -c sleep 30
/usr/bin/pmset -c displaysleep 60
/usr/bin/pmset -c disksleep 0
/usr/bin/pmset -c lessbright 0
/usr/bin/pmset -c halfdim 0/usr/bin/pmset -b sleep 5
/usr/bin/pmset -b displaysleep 5
/usr/bin/pmset -b disksleep 5
/usr/bin/pmset -b lessbright 1
/usr/bin/pmset -b halfdim 1
[/code]these values may not make sense for your environment, adjust where you think you should 🙂
for the “at random” autowake, go to system preferences > energy saver > schedule and enable “sart up or wake” and set a time. than copy /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist to somewhere and rename it 0.com.apple.AutoWake.plist
set another wakeup time in system preferences and again copy the com.Apple.AutoWake.plist rename this file to 1.com.Apple.AutoWake.plist and continue these last steps until you’ve collected 10 files (named 0 to 9)
put them in a folder and add following script to that folder[code]
/bin/rm /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
/bin/cp /Library/Deployment/AutoWake/`jot -n -r 1 0 9`.com.apple.AutoWake.plist /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist
[/code]it picks a number from 0 to 9 and takes that file and places it in the right place.
next, make sure this script runs at least once:
– using a suicidal startupitem
– using your favorite software distribution system
– …to keep my login- and logouthooks clean, i often use a login- and logoutwrapper. the loginwrapper is a simple script that runs every script in a given directory, the logoutwrapper is the same but for another directory and at logout 🙂
again, you can than drop login- and or logoutscripts using your favorite softare distribution systemApril 19, 2010 at 11:10 pm #378412JamesSimon
Participantit’s a good script. maybe we could use it here in our offices, and also have a program clocking the computers. is there a program the clocks the computer so as to hibernate when not used but applicable to each computer but only controlled by a master computer? is that possible? thanks.. looking for an energy saving setup.. thanks again!
-
AuthorPosts
- You must be logged in to reply to this topic.
Comments are closed