Run command on battery?

In order to save battery, I want to automatically kill my bittorrent client when I'm on battery power. Is there a tool that can easily let me do this?
I tried putting "killall transmission" in my /etc/acpi/handler.sh, but had no luck.

This might be a start for you: http://www.thinkwiki.org/wiki/ACPI_acti … ery_events

Similar Messages

  • MacBook Pro doesn't hibernate when runs out of battery

    Dear all,
    I've been experiencyng this issue for quite a while now and is very frustrating. My MacBook Pro (Early 2011) doens't go to sleep as it should when runs out of battery. It simply dies. This is not a continuous issues as it happens 1/2 oh the times that battery runs out and I cannot connect it to power (low battery warning is also working perfectly).
    Mac is stock besides HDD (now SSD) and RAMs. Battery stock as well and loks good in sysinfo (attached):
    Battery Information:
      Model Information:
      Serial Number:          D##########
      Manufacturer:          SMP
      Device Name: ######
      Pack Lot Code:          0
      PCB Lot Code:          0
      Firmware Version:          406
      Hardware Revision:          2
      Cell Revision:          158
      Charge Information:
      Charge Remaining (mAh):          6020
      Fully Charged:          Yes
      Charging:          No
      Full Charge Capacity (mAh):          6020
      Health Information:
      Cycle Count:          853
      Condition:          Normal
      Battery Installed:          Yes
      Amperage (mA):          0
      Voltage (mV):          12461
    It doesn't at all appear to be a HW issues, as batteries behaves normally and system sleeps corretcly at times. Indeed, seems to be a software issue as also running a pm set command in terminal after mac died returned this result:
    pmset -g assertions
    4/27/14, 10:55:41 AM GMT
    Assertion status system-wide:
       BackgroundTask                 1
       PreventDiskIdle                0
       ApplePushServiceTask           0
       UserIsActive                   0
       PreventUserIdleDisplaySleep    0
       InteractivePushServiceTask     0
       PreventSystemSleep             0
       ExternalMedia                  0
       PreventUserIdleSystemSleep     1
       NetworkClientActive            0
    Listed by owning process:
       pid 63(mds): [0x0000000c0000012e] 00:00:30 BackgroundTask named: "com.apple.metadata.mds.power"
       pid 116(mds_stores): [0x0000000c0000013a] 00:00:24 BackgroundTask named: "com.apple.metadata.mds_stores.power"
       pid 198(AddressBookSour): [0x0000000100000141] 00:00:21 PreventUserIdleSystemSleep named: "Address Book Source Sync"
              Timeout will fire in 1778 secs Action=TimeoutActionTurnOff
       pid 82(backupd-helper): [0x0000000c00000138] 00:00:28 BackgroundTask named: "backupd-helper"
       pid 85(apsd): [0x0000000c00000135] 00:00:30 InteractivePushServiceTask named: "com.apple.apsd-recreatecachedictionaries-sandbox.push.apple.com"
       pid 85(apsd): [0x0000000c00000130] 00:00:30 ApplePushServiceTask named: "com.apple.apsd-connectionestablish-push.apple.com"
       pid 85(apsd): [0x0000000c0000012c] 00:00:30 ApplePushServiceTask named: "com.apple.apsd-recreatecachedictionaries-push.apple.com"
       pid 11(UserEventAgent): [0x0000000c0000013b] 00:00:24 BackgroundTask named: "com.apple.metadata.mds_stores.power"
       pid 11(UserEventAgent): [0x0000000c0000012f] 00:00:30 BackgroundTask named: "com.apple.metadata.mds.power"
    No kernel assertions.
    It seems that Address book service prevents system from sleeping.
    Thank you in advance for your help!
    Bests,
    Alex

    Hi all,
    Thnk you for the reply.
    @andyBall: I though that the battery might run out sooner than what it reports, however it typically behaves behaves quite well - 5+ hours after fully charged and approximately 10 minutes of operation after low battery warning. Very hard that battery is running out before the system realize that. Yet I have to try the SMC reset. Will revert.
    @SilverSkyRat: I have one iCloud and one Gmail for work. Today I have disabled both and OS hibernated well (no failure). Later in the day I reactivated Gmail and system still hibernated fine. I mainly use the Mac for work therefore it's rather difficult to perform continus test of this kind. Although, system somtimes hibernates fine with also all account active.
    General question, which are the program associated with "Address Book Source Sync"? Only "Contacts"?
    Also, I have Little Snitch on the computer, may this be anyhow linked with this issue in your opinion/experience?
    Best regards,
    Alex

  • URGENT-How to run command in java application???

    URGENT!
    i would like to run command to invoke some applications (like invoke application using command line in DOS) in my java appication.
    Do anyone know how to do this? Thanks a lot.

    This question has been asked upteen times.
    ok the code is
    for win95
    Runtime.getRuntime().exec( "start c:\\tmp.txt" );
    for win 2000
    Runtime.getRuntime().exec( "cmd /C startc:\\tmp.txt" );
    //change the file to your desire file..
    i am not so sure about win98, sorry...

  • MBP running out of battery power before sleeping - Help!

    Hi
    My MacBook Pro has been running out of battery power before the memory-saving sleep mode kicks in, so it dies with a little click of the HD. It's not a hibernation state as when I reattach the power supply it boots up a new session.
    I've noticed this since upgrading to Snow Leopard last year, but put it down to an old battery that had 45% charge and wasn't powering the MBP properly. I now have a replacement A1175 5600mAh battery which is giving me 2-3hrs usage (which I'm pleased at), but now it still dies before sleeping!
    I have tried to cycle the new battery, but can't. I have reset the SMC several times, with no effect.
    I used to cycle the battery every week or two, running it down until it would no longer wake from sleep, recharge overnight etc, but now I can't do this because it will die before sleeping!
    I've read quite a few articles over the net about this issue, but there seems like no cure. It's really annoying me now as I frequently work on the move and a dying MBP could potentially be disastrous.
    Can anyone shed some light on this issue? Is there something I haven't tried yet? I think it's a late '06 MBP.
    From System Profiler:
    Hardware Overview:
    Model Name: MacBook Pro
    Model Identifier: MacBookPro2,2
    Processor Name: Intel Core 2 Duo
    Processor Speed: 2.16 GHz
    Number Of Processors: 1
    Total Number Of Cores: 2
    L2 Cache: 4 MB
    Memory: 3 GB
    Bus Speed: 667 MHz
    Boot ROM Version: MBP22.00A5.B07
    SMC Version (system): 1.12f5
    Battery Information:
    Model Information:
    Serial Number: ˇ{ïwl"Ó*%#Û˙� $«\
    Manufacturer: SMP
    Device name: ASMB012
    Pack Lot Code: a0b0
    PCB Lot Code: c0f1
    Firmware Version: 8800
    Hardware Revision: 0000
    Cell Revision: 0000
    Charge Information:
    Charge remaining (mAh): 1320
    Fully charged: No
    Charging: Yes
    Full charge capacity (mAh): 5315
    Health Information:
    Cycle count: 12
    Condition: Normal
    Battery Installed: Yes
    Amperage (mA): 1500
    Voltage (mV): 11560
    System Power Settings:
    AC Power:
    System Sleep Timer (Minutes): 10
    Disk Sleep Timer (Minutes): 10
    Display Sleep Timer (Minutes): 10
    Automatic Restart On Power Loss: No
    Wake On AC Change: No
    Wake On Clamshell Open: Yes
    Wake On LAN: No
    Current Power Source: Yes
    Display Sleep Uses Dim: Yes
    Battery Power:
    System Sleep Timer (Minutes): 0
    Disk Sleep Timer (Minutes): 10
    Display Sleep Timer (Minutes): 0
    Wake On AC Change: No
    Wake On Clamshell Open: Yes
    Display Sleep Uses Dim: Yes
    Reduce Brightness: No
    Hardware Configuration:
    UPS Installed: No
    AC Charger Information:
    Connected: Yes
    ID: 0x0100
    Wattage (W): 85
    Revision: 0x0000
    Family: 0x00ba
    Serial Number: 0x001e1900
    Charging: Yes

    If you are not getting a warning, then there is something amiss with your battery. If a SMC reset and calibration does not fix the problem, then you may need to make an appointment at the genius bar and arrange to have your battery tested.
    My old battery started doing the same thing--shutting down without warning. I replaced it, and the replacement battery started doing the exact same thing. I then returned the replacement, and the next replacement battery behaves in a normal fashion.
    My first battery was worn out. My second battery was defective. My third battery is good.
    Your battery should still be under warranty. Go back to where you got it and show them what it is doing and see if you can get a replacement.
    Good luck!

  • HT201412 even after all night of charging my ipod touch is running out of battery whithin 5 minutes of it being on, why is this?

    even after all night of charging my ipod touch is running out of battery whithin 5 minutes of it being on, why is this?

    Try the following to rule out a software problem.:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.
    If still that short of life ake an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • Error while running commands at RMAN prompt

    Hi ,
    We have a few oracle 10g(10.2.0.3) databases on AIX platform.We use RMAN backup with a recovery catalog database.
    The rman full(level 0)backups are scheduled dailly and running fine.When I tried to run commands like 'list backup','report obsolete' I'm getting the following errors.
    connected to target database: TICSPROD (DBID=2626621498)
    connected to recovery catalog database
    RMAN> report obsolete;
    RMAN retention policy will be applied to the command
    RMAN retention policy is set to redundancy 3
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of report command at 08/04/2011 07:49:36
    RMAN-06004: ORACLE error from recovery catalog database: ORA-03113: end-of-file on communication channel
    ORACLE error from recovery catalog database: ORA-03114: not connected to ORACLE
    RMAN> list backup;
    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of list command at 08/04/2011 07:56:25
    RMAN-06004: ORACLE error from recovery catalog database: ORA-03113: end-of-file on communication channel
    ORACLE error from recovery catalog database: ORA-03114: not connected to ORACLE
    But the recovery catalog database is up and running fine.For few other databases I'm able to run the above commands without errors and for some databases I'm getting the errors as mentioned above.
    Could someone help me out with this...

    Thanks Tycho for your reply.
    Please find the output of the query in recovery catalog.
    SQL> select * from v$resource_limit;
    RESOURCE_NAME CURRENT_UTILIZATION MAX_UTILIZATION INITIAL_AL LIMIT_VALU
    processes 49 83 5000 5000
    sessions 30 63 5505 5505
    enqueue_locks 27 94 65910 65910
    enqueue_resources 27 73 24440 UNLIMITED
    ges_procs 0 0 0 0
    ges_ress 0 0 0 UNLIMITED
    ges_locks 0 0 0 UNLIMITED
    ges_cache_ress 0 0 0 UNLIMITED
    ges_reg_msgs 0 0 0 UNLIMITED
    ges_big_msgs 0 0 0 UNLIMITED
    ges_rsv_msgs 0 0 0 0
    gcs_resources 0 0 0 0
    gcs_shadows 0 0 0 0
    dml_locks 0 76 24220 UNLIMITED
    temporary_table_locks 0 3 UNLIMITED UNLIMITED
    transactions 1 10 6055 UNLIMITED
    branches 0 0 6055 UNLIMITED
    cmtcallbk 0 1 6055 UNLIMITED
    sort_segment_locks 0 5 UNLIMITED UNLIMITED
    max_rollback_segments 11 11 6055 65535
    max_shared_servers 20 20 800 800
    parallel_max_servers 0 32 320 3600
    22 rows selected.
    The alert log of the catalog database is continously getting refreshed with the following message.
    Incremental checkpoint up to RBA [0x3b3.a780.0], current log tail at RBA [0x3b3.a78f.0]
    Mon Aug 8 00:16:17 2011
    Incremental checkpoint up to RBA [0x3b3.abf8.0], current log tail at RBA [0x3b3.ac4f.0]
    Mon Aug 8 00:46:19 2011
    Incremental checkpoint up to RBA [0x3b3.1451b.0], current log tail at RBA [0x3b3.1451b.0]
    Mon Aug 8 01:16:21 2011
    Incremental checkpoint up to RBA [0x3b3.14b15.0], current log tail at RBA [0x3b3.14baa.0]
    Mon Aug 8 01:46:23 2011
    Incremental checkpoint up to RBA [0x3b3.14be1.0], current log tail at RBA [0x3b3.14bf0.0]
    Mon Aug 8 02:16:25 2011
    Incremental checkpoint up to RBA [0x3b3.15069.0], current log tail at RBA [0x3b3.150a9.0]
    Mon Aug 8 02:46:27 2011
    Incremental checkpoint up to RBA [0x3b3.150ed.0], current log tail at RBA [0x3b3.150ed.0]
    What could be the potential cause of the issue I'm facing .Could you please guide me...

  • How do you fix lines that come up on an iPod Touch (5th Gen) once it turns on after running out of battery?

    This has happened to me about 4 times now. I just got a brand new iPod touch (5th Gen) after replaceing my 4th gen iPod. I havent had it for a month, so its still brand new. The only thing is that when the iPod runs out of battery it turns off (duh) but it doesnt turn back on when you plug it in to charge. When I noticed that the iPod doesnt turn on, and I hit the power button, lines appear on my screen. They are lines that run up and down the screen from left to right. I try factory resets, setting resets, restoring my iPod. But this issue keeps coming up. I honestly dont know what to do. This thing is brand new and its acting up on me. Should I take it to my apple store? Should I just put up with it. I have tried everything and at this point I dont know what to do anymore. Please help!!

    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar
    Since you restored to factory settings/new iPod and still have the problem that indicates a hardware problem
    If the iPod is defective within warranty (you indicate it is) and not abused Apple will exchange it on the spot.

  • How to run command SQLLoader Oracle in c#

    Hello,
    How to run command SQLLoader Oracle in c#. I try my sourcode for run this SQLLoader, but nothing happen and error "No process is associated with this object.". Please tell me how i fix it. Thanks.
    This is my code:
    System.Diagnostics.Process process1;
    process1 = new System.Diagnostics.Process();
    process1.EnableRaisingEvents = false;
    string strCmdLine;
    strCmdLine = @"/C SQLLDR XL/secreat@O11G CONTROL=E:\APT\LoadXL.ctl";
    System.Diagnostics.Process.Start("CMD.exe", strCmdLine);
    process1.WaitForExit();
    process1.Close();

    jesperdj ,thanks:)
    actually,i am using eclipse to run my ant tasks programmatically,but I got trouble with the AntRunner class.it seems that i should config a proper classloader for it,but i just don't know how.please lend a hand:)thanks
    robin

  • BUG: Run command does not follow current project

    The Debug command respects which project is currently active, i.e. selected by the user in the project folder.
    The Run command, however, does not.
    Version 11.1.1.0.31.51.56
    Workaround:
    Choose a class file with a main method, then issue run.
    Regards,
    Erik

    Hi,
    is it as web project or a Swing project ?
    Frank

  • No "Run" command (FB4 standalone, Mac OS X)

    I downloaded FB4 and installed it as standalone. I can't find a "Run" command that works anywhere in the program's menus or toolbars.
    I had Eclipse (the Cocoa version, hence why I installed FB4 as standalone) and parts of Adobe CS4 Master Collection already installed on this computer. I am positive I'm running the copy of Eclipse that was installed with FB4, rather than my exlsting copy.
    Here are images of my toolbar and the "Run" menu.
    How can I configure FB4 to allow me to test my AS3 programs?

    Hmm, perhaps I spoke too soon.
    The run commands are available in the program's default workspace. They disappear when I switch to another workspace (in this case, example files from a lynda.com course).
    Maybe I should do some more research on my end...

  • My I pad only turns on for a second then runs out of battery again

    So my ipad ran out of battery so I connected it to a wall charger. It re-boot but the lock screen flashes for about a second then runs out of battery again. I have tried well over 20 times to fix it but nothing worked. Any suggestions?

    Not charging
    1. Reset iPad; hold the Sleep/Wake and Home button down until you see the Apple Logo
    2. Try another wall socket
    3. Try another cable (make sure it's an original Apple cable)
    4. Try another charger (make sure it's an original Apple charger)
    5. Clean Lightning port with compress air or new paint brush

  • Using computer variables in task sequence "Run Command Line"

    I am attempting to deploy VMs through VMware's vRealize Automation tool using CM. The process creates a CM computer object then creates a direct rule on a CM collection for the new computer object. During the creation of the computer object vRA creates computer
    variables provided by me on the computer object. I see the computer object built and i see the custom variables on the computer object:
    Name Value
    dns1 10.10.10.10
    dns2 10.10.10.11
    gateway 10.10.10.1
    ipAddress 10.10.10.2
    netMask 255.255.255.0
    In the task sequence the last step is to "Run Command Line":
    cmd /c netsh int ip set address name="Ethernet0" static %ipAddress% %netMask% %gateway% & cmd /c netsh int ip set dns name="Ethernet0" static %dns1% & cmd /c netsh int ip set dns name="Ethernet0" static %dns2% index=2
    When the TS gets to that step it doesn't substitute the variables in the command with the computer variables listed above. Looking at the smsts logs after the deployment is complete I see lines stating:
    Set Command Line:...
    Start executing command line:...
    Executing command line:...
    ProgramName = ...
    All of those lines show the command exactly as it is above with the %variables% intact.
    The command immediately fails with the error:
    Invalid address parameter (%ipAddress%). It should be a valid IPv4 address.
    Does anyone have a suggestion on why the TS isn't using the variables? I found this article https://technet.microsoft.com/en-us/library/bb693541.aspx but its for 2007 not 2012. I wasn't able to find something comparable for 2012.

    I don't know why anyone here thinks you *need* sccm osd to achieve fully automated customizations.
    Customer selects base image (2008 r2 core, 2008r2 gui, 2012 r2 core, 2012 r2 gui), which should be thin and with zero customizations anyway,
    vaai accelerated clone creates vm,
    ip addr/gateway/dns config is injected with powercli,
    customers config management engine agent of choice is installed via powercli script injection/execution (we have puppet users, ConfigMgr users, saltstack users, IEM users, Cheff users),
    the clone completes in ~2 minutes and a VM is presented to the customer in less than 5 minutes 
    Deploying windows VMs via SCCM OSD is not only slow, but requires dev work on the customer side to get things rolling which wastes everyone's cycles including your own

  • BO Edge 4.0 Installer stuck on "Run command-line executable"

    Hi,
    Our BO Edge BI Server 4.0 Installer on Windows Server 2008R2 is stuck on one of the last steps; "Run command-line executable".
    Before is was stuck on "WaitForCMSForTheFirstTime". We upped the RAM to 16GB and then the installer went past this, but after a full reset of the server and trying again it is now stuck a few steps later on "Run command-line executable". This is very frustrating, especially since there is no error message at all, no install log and the installer is just stuck indefinitely and we had to cancel it.
    At that point the Central Configuration Manager shows this:
    Apache Tomcat - Running
    BW Publisher Service - Stopped
    SAP BO Mobile Authentication Server - Stopped
    SAP BO Mobile Processing Server - Stopped
    Server Intelligence Agent - Running
    We can't deinstall from Windows to start over at this point because the installer says an install is in progress.
    What is going on?
    Help urgently needed and appreciated
    Edited by: J. Knulst on Jan 11, 2012 7:48 AM
    Edited by: J. Knulst on Jan 11, 2012 7:50 AM

    Hello,
    Yes, certain stages run for a long duration. "Run command-line executbale" runs for atleast 45 mins. It's normal.
    My suggestion would be to leave it for 45 mins-90 mins.
    Now that you have interrupted your installtion, try uninstalling it through the control panel.
    In case you can't see the software there, then you have to edit registry entries, which is very tiresome.
    Regards,
    Sonia

  • Cannot run command window

    In Windows I would expect to call up a seperate command window with the following, but it appears to freeze up. What am I doing wrong?
    import java.io.*;
    public class command {    
      public static void main(String[]args) {
        try {
          Process runprogram = Runtime.getRuntime().exec("C:\\windows\\system32\\cmd.exe");
          try {
            runprogram.waitFor();
          catch(InterruptedException e){}
        catch(IOException e) {
          System.err.println("Cannot run command window");
    }

    What about this...
        Process proc = null;
        try
          proc = Runtime.getRuntime().exec("start cmd");
          proc.waitFor();
        catch(Exception e)
          e.printStackTrace();
        }Some dukies would be nice next time ;-)

  • Run commands in new tab in Terminal.app

    hello, i want to know is there a way to run commands and these opens a new tab in terminal.app.
    i know i can open a new tab with cmd+t , but i have a folder with hundreds of files with the name [email protected] and each file has the string ssh://username@server...
    i use these folder in the dock like a bookmark of servers that i administrate, if i set that ssh default is the app iTerm.app then every of these file i execute opens in a new tab of iTerm, but if i set ssh default to Terminal.app for every file open a new windows of Terminal.
    I would like to use Terminal.app if somebody help to find a way to open these conections in a new tab.
    You can try to open the terminal.app, them in safari type ssh://localhost... and you see a new window of terminal.
    Sorry for my bad english
    Regards
    Diego.

    I wonder if you're too tied to one solution. I do a very, very similar thing to what you're doing, except that I support 900 or so machines (I work for a hosting provider -- so, I'm not kidding.. promise!).
    The basics of my setup are as such:
    I have the host names of all the servers in a text file. In my .bash_profile I have a routine that loops through each server name and, if needed, generates a bash script named for the server in a directory I've set up in my path (~/bin/hosts). That file has the command string for ssh that I use to connect to the server in it. For example, for a server named 'foo', I'd have a file named '~/bin/hosts/foo', and the contents would look something like this:
    ssh -X username@foo
    This is the part I really like. I create each one as it's own bash script so that it can be found and indexed by spotlight, which I use as my app launcher. So, once each script has been created, all I have to do is cmd-space (to open spotlight) then type in the server name to continue. This works great except that it opens a new window every time. So annoying. As of today, though, I now have a new bash script:
    tab ssh -x username@foo
    A very small change, but with a huge effect. The other change is that I put the "tab" subroutine in a bash script in my path as well. So, now when it launches the ssh command it's in a new tab. Exactly as I wanted.
    I'm hoping this will help you. Even if not, though, try to remember to keep an open mind. I know the "url" scheme you're using works well, but I actually prefer my way (of course.. I made it up ). Whichever way you go, I wish you the best of luck.
    Cheers,
    4

Maybe you are looking for

  • HP Color LaserJet Pro MFP M177 Series Fax sends but won't receive faxes

    I can send faxes using HP Color LaserJet Pro MFP M177 Series Fax but I cannot receive them. I have faxed test pages and the setup is correct. Any suggestions?

  • .pdf attachment problems

    I have been having problems with my mail reversing the colors of any pdf attachments I get. It is just the preview of the pdf. If I open it in acrobat I can read it just fine. Any idea what setting in my mail would effect this?

  • Query related to frieght

    hi there I have a scenario where the user have created the PO He has entered the frieght value & all other He has done GR also After that he has done the invoice & paid the invoice But he has not paid the frieght Now he is asking me to delete the fri

  • VA02 core modifcation

    Hi everyone, Even though SAP is not recommending core modification, we have a requirement to do core modification in VA02 transaction. As per the requirement if user goes to Deliver menu (VA02 -> Enter -> Sales Document -> Deliver) by default it goes

  • 8.0.2 update completed but new options not showing up

    I've downloaded the Mac 8.0.2 update and successfully installed it but the changes don't seem to be taking effect. When trying to convert my pages with Flash content I'm not able to access any options to do so. They don't appear, as if I hadn't insta