äºåº¦å¯ã¹ãªã¼ãã§ã¡ã¢ãªãã¬ãããªè§£æ¾ãã¦ãã
æè¿ã¯MacBookã®ç¡ç ï¼ã¹ãªã¼ãï¼ã«ã¤ãã¦ãããããã¨èª¿ã¹ããã¨ãå¤ãã£ãã
ãã®éç¨ã§ãã¹ãªã¼ãã«ã¯ãããããªã¢ã¼ãããããã¨ãåãã£ããæ¨å¥¨ããã¦ããã®ã¯3ã¤ã®ã¢ã¼ããhibernatemode 0 or 3 or 25ã
æåã¯æ·±ãèããã«hibernatemode 25ãã¦ã¿ããã¹ãªã¼ããããã¨é»æºããªãã«ãªãä¸ç¬ãããããé»æºãã¿ã³ãæ¼ãã¦æ«ãããã¨ç´åã®ä½æ¥ç°å¢ã«å¾©å ããããã¤ã¾ããã¡ã¢ãªããã¼ããã£ã¹ã¯ã«éé¿ããã¦ãé»æºãå®å ¨ã«ãªãã«ããã¹ãªã¼ããªã®ã ããªãã»ã©ãã¨åãã£ãæ°ã«ãªã£ã¦ããã
ããã«ãã¦ãã0ã3ã«ç¶ãã¦ããããªã25ï¼ãã®hibernatemode 25ã ããç°è³ªãªæããããã®ã¯æç½ã ãããä¸ä½ãªã25ãªã®ãï¼æã¯ãããªã¢ã¼ãã¯ãªãã£ãã¯ããï¼ç¢ºãã0ã3ã1ã ã£ãæ°ãããï¼ä¸æ¦æ°ã«ãªãå§ããã¨ãã¨ã£ã¦ãæ°ã«ãªãããã®çãã¯ããã¥ã¢ã«ï¼man pmsetï¼ã«ãã£ãã
SAFE SLEEP ARGUMENTS
hibernatemode takes a bitfield argument defining SafeSleep behavior. Passing 0 disables SafeSleep altogether, forcing the computer into a regular sleep.
- ____ ___1 (bit 0) enables hibernation; causes OS X to write memory state to hibernation image at sleep time. On wake (without bit 1 set) OS X will resume from the hibernation image. Bit 0 set (without bit 1 set) causes OS X to write memory state and immediately hibernate at sleep time.
- ____ __1_ (bit 1), in conjunction with bit 0, causes OS X to maintain system state in memory and leave system power on until battery level drops below a near empty threshold (This enables quicker wakeup from memory while battery power is available). Upon nearly emptying the battery, OS X shuts off all system power and hibernates; on wake the system will resume from hibernation image, not from memory.
- ____ 1___ (bit 3) encourages the dynamic pager to page out inactive pages prior to hibernation, for a smaller memory footprint.
- ___1 ____ (bit 4) encourages the dynamic pager to page out more aggressively prior to hibernation, for a smaller memory footprint.
We do not recommend modifying hibernation settings. Any changes you make are not supported. If you choose to do so anyway, we recommend using one of these three settings. For your sake and mine, please don't use anything other 0, 3, or 25.
- hibernatemode = 0 (binary 0000) by default on supported desktops. The system will not back memory up to persistent storage. The system must wake from the contents of memory; the system will lose context on power loss. This is, historically, plain old sleep.
- hibernatemode = 3 (binary 0011) by default on supported portables. The system will store a copy of memory to persistent storage (the disk), and will power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from disk image.
- hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The system will store a copy of memory to persistent storage (the disk), and will remove power to memory. The system will restore from disk image. If you want "hibernation" - slower sleeps, slower wakes, and better battery life, you should use this setting.
Please note that hibernatefile may only point to a file located on the root volume.
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/pmset.1.html
è±èªã¯è¦æãªã®ã ããèªåã®ç解ãæ¸ãã¦ããã
- ã¤ã¾ããhibernatemodeã¯8ãããã®2é²æ°ã¨ãã¦ãåæ¡ã«æå³ãæããã¦ããã
bit 7 | bit 6 | bit 5 | bit 4 | bit 3 | bit 2 | bit 1 | bit 0 | =10é²æ° | |
---|---|---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | =0 | |
0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | =3 | |
0 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | =25 |
- bit 0ï¼1=ãã¤ããã¼ã·ã§ã³ ã¢ã¼ãï¼=å¬ç ã¢ã¼ããã¹ãªã¼ãã§ã¡ã¢ãªã®ç¶æ ããã¤ããã¼ã·ã§ã³ ã¤ã¡ã¼ã¸ï¼/var/vm/sleepimageï¼ã«æ¸ãåºããã¹ãªã¼ã解é¤ã§ãã¤ããã¼ã·ã§ã³ ã¤ã¡ã¼ã¸ãã復å ããï¼
- bit 1ï¼1=ããããªã¼ã¬ãã«ãä½ä¸ããã¾ã§é»æºãç¶æããã0=ããã«é»æºããªãã«ãããï¼bit 0ã1ã®å ´åã¨é£åãã¦æå³ãããï¼
- bit 3ï¼1=ãã¤ããã¼ã·ã§ã³ããåã«ãã¡ã¢ãªã®éé¿ã¨ãªã¢ããªãã¹ãå°ãããããããã¤ã³ã¢ã¯ãã£ããªã¡ã¢ãªé åã®ãã¼ã¸ã¢ã¦ããä¿é²ããã0=ç¹ã«ä½ãããªãã
- bit 4ï¼1=ãã¤ããã¼ã·ã§ã³ããåã«ãã¡ã¢ãªã®éé¿ã¨ãªã¢ããªãã¹ãå°ãããããããããç©æ¥µçã«ãã¼ã¸ã¢ã¦ããä¿é²ããã0=ç¹ã«ä½ãããªãã
ãã£ã¦ã25=ãã¼ã¸ã¢ã¦ããä¿é²ãã¦ç¢ºä¿ä¸ã®ã¡ã¢ãªé åãå°ãããã¦ãããããã«é»æºããªãã«ãããã¤ããã¼ã·ã§ã³ ã¢ã¼ãã
- ãªãã¨ããã¾ã«ã¡ããã¨ããã¥ã¢ã«ãèªãã¨ãã¨ãã§ããªãè¡æçãªãã¨ãæ¸ãã¦ããï¼
- ã¤ã¾ããã¡ã¢ãªã®è§£æ¾ãä¿é²ãã¦ããã¹ãªã¼ãããã¨ããã®ã ã
ã¡ãªã¿ã«ãéå»ã«ããã¦ã¯...
- bit 2ï¼1=ãå®å ¨ãªä»®æ³ã¡ã¢ãªã使ç¨ãã®å ´å1ã«ãã¦ããããããã£ãã
å®é¨
- æåã®ã¡ã¢ãªã®ç¶æ ã
- hibernatemode 1ã§ã¹ãªã¼ãã»ã¹ãªã¼ã解é¤ããã¡ã¢ãªã®ç¶æ ã
- ã»ã¨ãã©å¤åãªãã
- hibernatemode 25ã§ã¹ãªã¼ãã»ã¹ãªã¼ã解é¤ããã¡ã¢ãªã®ç¶æ ã
- ã¬ãããªè§£æ¾ãããï¼
ææ
- hibernatemode 25 ã§ã¹ãªã¼ãããã¨ãã¡ã¢ãªã¯ã¬ãããªè§£æ¾ãããã
- ããã¯ãdu -sx /ãdiskutil verifyPermissions /ãpurgeï¼ã¡ã¢ãªã解æ¾ãã¦ã¹ã¯ããçºçãæããæ¹æ³ï¼ã«ç¶ã第åã®æ¹æ³ã§ãã¡ã¢ãªè§£æ¾ã®å¹æã¯æ大ã ã£ãã
- hibernatemode 25ã®ã¹ãªã¼ã解é¤ãã¦ãããduã»duskutilã»purgeçã®ã³ãã³ããå®è¡ãã¦ããã¡ã¢ãªè§£æ¾ã®å¹æã¯å ¨ããªãã£ãã
- ä½ãããã¤ããã¼ã·ã§ã³ã¢ã¼ãã®å¤æ´ã¯æ¨å¥¨ããªãã¨ãman pmsetã«æ¸ãã¦ããã
- ã©ããªå¤æ´ããµãã¼ãããªãã¨ã
- å¤æ´ãããªãã以ä¸ï¼ã¤ã®ãã¡ã®ã©ãããæ¨å¥¨ãã¦ãããããã
- ãããããã0ã»3ã»25以å¤ã使ããªãããã«ãã¦ãã ããã¨ã
- ã¾ããèªåã®MacBookç°å¢ã«ããã¦ãã¹ãªã¼ãã«30ç§ãã¹ãªã¼ã解é¤ã«60ç§ãããã®æéãããã£ã¦ãã¾ã...ã
- å代MacBookã ã¨ãã¹ãªã¼ãã»ã¹ãªã¼ã解é¤ã¨ãããã£ã¨ç´ æ©ãã®ã ãã©ãï¼æè¼ã¡ã¢ãªã®éããï¼2Gã¨4Gã®éãï¼ï¼
人ãMacãç¡ç ã大äºããã£ããç ãã°ãæ大ã®ããã©ã¼ãã³ã¹ãçºæ®ãããå°ç¬ åæ°å£ã®çå¤æ¥ï¼ç±å¸¯å¤ãªæ»æã¨ç¯é»ãã¼ã ã«è² ããªãã§ããã£ããç ãããã
äºåº¦å¯ã¹ãªã¼ãã§ã¡ã¢ãªã解æ¾ããAppleScript
- hibernatemode 25ã®ã¹ãªã¼ãã§ã¡ã¢ãªãã«ãããªè§£æ¾ããããã¨ã¯åãã£ãã®ã ããå®å ¨ã«é»æºããªãã«ãªã£ã¦ãã¾ãã®ã§ãWake on Demandãªãµã¼ãã¼ã¨ãã¦ãæ©è½ããªããªã£ã¦ãã¾ãã®ã¯æ®å¿µã
- ãªãã°ãhibernatemode 25ã®ã¹ãªã¼ã解é¤ãå¾ ã£ã¦ãhibernatemode 0ã®ã¹ãªã¼ããããç´ãã°è¯ãã®ã ããèªåã®MacBookã§ã¯hibernatemode 25ã®ã¹ãªã¼ãã»ã¹ãªã¼ã解é¤ã«ãããæéãããã...ã
å¾ ã¡ãããªãï¼
- ãªãã°ãã¤ãã®AppleScriptï¼ã·ã§ã«ã³ãã³ãã¨çµã¿åããã¦ï¼ã§ãã´ãã§ã´ãã§ãã£ã¦ã¿ãã
- æé ã¯ã·ã³ãã«ã
- ã¹ãªã¼ã解é¤ã®äºç´è¨å®ããã¦ãhibernatemode 25ã§ã¹ãªã¼ãããã
- äºç´æéã«ç®è¦ããããããã©ã«ãã®hibernatemodeï¼0 or 3ï¼ã§åã¹ãªã¼ãããã
property pw : ""
my save_password() my double_sleep()
on save_password() if pw = "" then
activate
display dialog "管çè ãã¹ã¯ã¼ããå ¥åãã¦ãã ããã" default answer "" with hidden answer
set pw to result's text returned
end if
end save_password
on double_sleep() "(s=`date +\"%s\"`; s=`expr $s + 60`; h=`pmset -g|grep hibernatemode|cut -f2`; pmset schedule wake \"`date -r $s +\"%D %T\"`\"; pmset -a hibernatemode 25; pmset sleepnow; sleep 60; pmset -a hibernatemode $h; sleep 120; pmset sleepnow;) >& /dev/null &"
do shell script result password pw with administrator privileges
end double_sleep
- ã¡ãªã¿ã«ãã·ã§ã«ã³ãã³ãä¸ã®sleep 60ãsleep 120ã§ãªãå¾
æ©ããã®ãï¼
- hibernatemode 25ã®ã¹ãªã¼ãå¦çä¸ã§ããsleep 60ã§å¾ æ©ãã¦ãããªãã¨ã³ãã³ãã次ã ã¨å¦çããã¦ãã¾ãã®ã§ã
- ãããã¯ãsleep 120ãããã®å¾ æ©æéãåã£ã¦ãããªãã¨ãåã¹ãªã¼ãããå¾ã«ãåæã«ç®è¦ãã¦ãã¾ãã®ã§ã
- ç°å¢ã«ãã£ã¦ã¯ãå¾ æ©æéã¯ãã£ã¨çãã¦ãã¡ããã¨åä½ããã¨æãã
ããã§ãã¡ã¢ãªã解æ¾ãããWake on Demandãæå¹ãªæ¬²å¼µããªã¹ãªã¼ããå®ç¾ã§ããï¼
- å¸ãé¢ããæã«äºåº¦å¯ã¹ãªã¼ããå®è¡ãã¦ããã°ã幸ãã«ãªãã
- Quicksilverã§command-option-F12ã«ã·ã§ã¼ãã«ãããå²ãå½ã¦ãã
- ã¡ãªã¿ã«ãcommnad-option-Eject ï¼ é常ã®ã¹ãªã¼ãããã®é£ã ã
ã³ãã³ãã®ä¸èº«ã«ã¤ãã¦
- AppleScriptã®æååã¨ãã¦ã·ã§ã«ã¹ã¯ãªãããæ¸ãã¦ããã®ã§ãããã«ã¯ã©ã¼ããã¨ã¹ã±ã¼ãï¼webä¸ã¯åè§ï¿¥ã«ãªã£ã¦ããããæ¬æ¥ã¯åè§ï¼¼ã§ããï¼ããèªã¿ã«ãããªã£ã¦ããã
- å®è¡ããã段éã§ã¯ã以ä¸ã®ã·ã§ã«ã¹ã¯ãªããã¨ãã¦è§£éããã¦ããã¯ãã
( #1 s=`date +"%s"`; #2 å¤æ°sã«ç¾å¨ã®æå»ï¼1970/1/1ããã®ç©ç®ç§æ°ï¼ãä¿åãã¾ãã s=`expr $s + 60`; #3 å¤æ°sã«60ãå ç®ãã¾ãã h=`pmset -g|grep hibernatemode|cut -f2`; #4 å¤æ°hã«ç¾å¨ã®hibernatemodeãä¿åãã¾ãã pmset schedule wake "`date -r $s +"%D %T"`"; #5 ã¹ãªã¼ã解é¤æéãäºç´ãã¾ãã pmset -a hibernatemode 25; #6 hibernatemode 25ãè¨å®ãã¾ãã pmset sleepnow; #7 ã¹ãªã¼ããã¾ãã sleep 60; #8 60ç§å¾ æ©ãã¾ãã pmset -a hibernatemode $h; #9 å ã®hibernatemodeã«æ»ãã¾ãã sleep 120; #10 120ç§å¾ æ©ãã¾ãã pmset sleepnow; #11 åã³ã¹ãªã¼ããã¾ãã ) >& /dev/null & #12 æ¬å¼§()å ã®ã³ãã³ãã¯ããã¯ã°ã©ã¦ã³ãã§å¦çããè¿ãå¤ã¯ãã¹ã¦ç ´æ£ãã¾ãã
ããã«è©³ç´°ã«è¦ã¦ããã¨...
#2ã#3
- `ã³ãã³ã` ã§å²ã¾ããä¸èº«ã¯ãã·ã§ã«ã³ãã³ãã¨ãã¦å®è¡ããçµæã§ç½®ãæããããã
- ã¤ã¾ããAppleScriptã§ãã Run Script "ã³ãã³ã" ã¨åçãªã®ã ã
- å®éã«ä½ã«ç½®ãæãããããã¯ã`ã³ãã³ã` å ã®ã³ãã³ããã³ãã¼ãã¦ãã¿ã¼ããã«ã§å®è¡ãã¦ã¿ãã¨ä¸ç®çç¶ã
- æçµçã«ãå¤æ°sã«ã¯ç¾æç¹ãã60ç§å¾ã®æå»ãã1970/1/1ããã®ç©ç®ç§æ°ã§ä»£å ¥ãããã®ã ã
- ãããããã®ãã¨ã¹ãªã¼ãã解é¤ããéã®äºç´æå»ã«å©ç¨ããã
#4
- 2段éã®ãã¤ãã§ãpmset -gã®çµæãããç¾å¨ã®hibernatemodeãåå¾ãã¦ããã
- ãã¤ãã«ã¤ãã¦ã¯ã以ä¸ã®æ¥è¨ãåèã«ãªããããããªãã
#7ã#8ã#10ã#11
- sleep 60 ã¯ãã·ã§ã«ã³ãã³ãã«60ç§å¾ æ©ãããã³ãã³ããAppleScriptã§ããDelay 60ã¨åçãªã®ã ã
- pmset sleepnow ã¯ãMacBookã«ã¹ãªã¼ããã¦ãããã³ãã³ãã
- ã©ã¡ããsleepãå«ã¾ãã¦ãã¦ç´ããããããã¾ã£ããæå³ãéãã®ã ã
#12
- do shell scriptã§ã³ãã³ããããã¯ã°ã©ã¦ã³ãã§å¦çããããã®ãã¾ããªãã以ä¸ã®æ¥è¨ãåèã«ãªããããããªãã