Can I execute commands when my system switches to UPS battery or shutdown?

Hi, I am trying to execute some custom commands when the power goes out and my mac is running on battery from an uninteruptible power supply (UPS).  I did some research and read that a script is executed when OS X shuts down when critera are met while its is running on battery from a UPS. UPS is supported by Mac OS because it shows up in the Energy Saver Preference plane.
This script is:  /usr/libexec/upsshutdown
I modified this script, but it looks like my custom commands are not executed.
Does anyone know if mountain lion still executes this script?
2012 Mac Mini Server
CyberPower CP1000PFCLCD

Okay. I think I know what the problem is. Here's the exact sequence I follow. I am thinking SQL Developer is not doing exactly what it should.
a) File > New and then click okay
b) The top dialog box shows the file name: Untitled2.sql
c) I rename this to abcd and click okay
d) SQL worksheet opens with the following filename "abcdsql" <- there's no dot between abcd and sql !
e) I enter in "select * from dual"
f) execute and it works fine
g) I click save and it saves it as abcdsql <- NO extension
Before I had not been looking carefully. I had seen the word "abcdsql" and thought it was "abcd.sql".
Now my question is why does it append "sql" to the filename? I was in the box for naming a new sql file. It allowed me to type in a file name but then instead of adding "sql" as an extension it just appended this to the filename and didn't give it an extension.
Anyone else tried this? It seems like a very non-standard thing to do. I never saw an application that just appended "sql" to the filename when it should have given the file a ".sql" extension.
Richard

Similar Messages

  • Can't execute command - drive didn't come online; check configuration/hardw

    I have a Scalar i500 on a Linux host attached via fiber channel. I have everything working accept automounting the drive. I can't seem to get it working.
    I can use the web interface of the i500 and then put a tape in the drive. I can then mount the drive from Secure Backup and run a back up just fine. Yet, I can't run a backup without a tape mounted. If I choose "Load Volume (Drive).... I get the error "can't execute command - drive didn't come online; check configuration/hardware"
    I can inventory the library and do just about anything except automount the drives. I run a verify and the configuration comes back clean with no errors. I have tried using the SCSI params in the obl0 and obt0 ,and obt2 with no success. I have tried using the raw /dev/sg paths with no success. Same error.
    This is a upgraded installation from 10.1 to 10.3. I have tried doing a clean install with same issue. I have restored the installation and then run a upgrade with the same issue.
    I am stuck. Please help :)
    Thanks

    It appears you may have the DTE's swapped.
    Swap the DTE #'s assigned to the drive device objects and try again. This could happen during an upgrade if you reassigned scsi settings and the obt0 and obt1 devices swapped scsi settings from when they ran things last.

  • Macbook Pro retina display 13 inch stopped charging. Charger LED also not on while plugged in. The battery fully drained off but the system can detect the charger when it was switched on.

    Macbook Pro retina display 13 inch 2014 model stopped charging. Charger LED also not on while plugged in. The battery fully drained off so the system can not be started but the system can detect the charger when earlier it was switched on before draining off the charge. Charger type magsafe 60W.

    Once you have examined the power inlet on the computer for dirt, and made certain that the pins on the end of the MagSafe cord are free to move in and out to make contact, there is very little you can do yourself.
    You will need to visit your Apple Store (FREE with appointment) or your Apple-Authorized Service Provider (policy varies). They work on these all the time and have good expertise and lots of spare parts to try to determine the problem.

  • Executing commands when connection pool connections created

    Is there any way to set up connection pools to automatically execute a
    command when a connection is created?
    The system I'm working on needs (for a number of reasons outside of our
    control) to switch our connection to be rule based by executing:
    alter session set optimizer_goal=RULE;
    I guess we could add this functionality into our "getConnection" method but
    this just seems kind of inefficient.
    We're using WLS5.1sp11 on solaris2.6 talking to oracle 8.1.7 using
    weblogic.jdbc20.oci.Driver.
    Does anyone have any ideas on how to persuade JDriver to initialise the
    pool with the command above?
    Thanks
    Barry

    Barry Munro wrote:
    Is there any way to set up connection pools to automatically execute a
    command when a connection is created?no, but...
    The system I'm working on needs (for a number of reasons outside of our
    control) to switch our connection to be rule based by executing:
    alter session set optimizer_goal=RULE;
    I guess we could add this functionality into our "getConnection" method but
    this just seems kind of inefficient.
    We're using WLS5.1sp11 on solaris2.6 talking to oracle 8.1.7 using
    weblogic.jdbc20.oci.Driver.
    Does anyone have any ideas on how to persuade JDriver to initialise the
    pool with the command above?One trick you can do is to define the pool's connection test to do this
    every time you reserve a pool connection, instead of doing a query to DUAL or
    whatever test table you define. Define the testTable to be:
    testTable=SQL alter session set optimizer_goal=RULE,\
    testConnsOnReserve=true,\
    Joe
    Thanks
    Barry

  • Terminal command, when in system install disc

    I was wondering if anyone could clue me in to a terminal command for when I am booting off the System disc, and need to get to the root on my HardDrive, or home folder

    OK, if the drive isn't mounted then mount it with /sbin/mount -uaw or use Disk Utility in the menu to mount it, then look for /Volumes in Terminal.
    Sorry, can't reboot off the Install disk to garner the exact commands, but it sounds like you may just need an inkling anyway!

  • WLan can be enabled only when NB200 is switched on

    I have a n Equium Laptop and a NB200 netbook.
    I set up the new NB200 netbook a couple of days ago and had the same problems experienced by others trying to switch the Wifi on!
    That is now OK, but I'm finding that the Laptop can only access the Wifi now if the Netbook is switched on (the Laptop was fine before the Notebook appeared!). Obviously, in setting up the Netbook access I've done something stupid, but I can't imagine what it is!
    Hopefully someone can suggest a solution.
    Thanks

    I think maybe I haven't explained it very well!
    The problem is that the Equium Laptop can't access the internet unless the NB200 Netbook is switched on.
    When the Netbook is switched off, the Laptop shows messages saying little or no connectivity to access the internet.
    As soon as I switch the Netbook on, the laptop connects fine.

  • My Iphone 5s blank screen and can hear voice command when i press the home button

    My Iphone 5s was coming up with voice command and driving me nuts. After trying  to reset the phone now I just have a blank screen.  when i goes to restart the apple icon will show then the voice command  lady will talk in the back ground but still no screen.
    Any help please

    Try one of these 4Rs toubleshooting steps:
    Restart:
    1. Press and hold the Sleep/Wake button until the red "slide to power off" slider appears, and then slide the slider.
    2. Press and hold the Sleep/Wake button until the Apple logo appears.
    Reset: Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Note: You will not lose any data
    Restore from backup
    Restore as new
    http://support.apple.com/kb/HT1414

  • How can I execute command passwd in solaris with Java (ProcessBuilder)

    Hi all, my problem is that I want to change the user password in solaris 10, but from a Java programm, I was trying with ProcessBuilder but I don't know how insert the new password, Who can help me?

    I'm not sure, but I think passwd is one of those programs that only lets itself be run interactively from a terminal.

  • HT5559 Can't execute command number 4.

    sudo ln -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI .plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    sudo ls -sf /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI .plugin /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin
    ls: /Library/Internet Plug-Ins/JavaAppletPlugin.plugin: No such file or directory
    /System/Library/Java/Support/Deploy.bundle/Contents/Resources/JavaPlugin2_NPAPI. plugin:
    total 0
    0 .                    0 ..                    0 Contents
    This How To doesn't work. Please help me with this.

    Please see
    http://java.sun.com/j2ee/1.4/docs/tutorial/information/faq.html#compile

  • How can i execute trigger from procedure

    Hi
    How can i execute trigger when-button-pressed from procedure.
    I knew i have to get the button name and then execute the trigger When-button-pressed.
    but how can i do that.
    Thanks
    null

    how can i execute trigger
    such as When-Button-Pressed on item name "item1"
    and i have more than one trigger with this name on onther
    items
    i know Execute_Trigger('when-button-pressed');
    but any trigger
    for example :
    Execute_Trigger('Item1.when-button-pressed');
    or
    Execute_Trigger('Item2.when-button-pressed');
    or
    other syntax
    i dont know
    please help me
    my email : [email protected]
    Hani

  • Execute commands on a remote server

    hello,
    1. how can i execute commands on a remote server using java (how to connect and how to execute) without having java on the remote server
    (i cannot connect with Socket object)
    2. how can i execute commands on the local computer
    please help me

    Well, for #1, if you can possibly know what commands you'd have to call you could set a perl script up on the remote machine to perform that command and return to you the results. problem is, you'll have to have a web server of some sort to do this (as far as i know).
    I know it's not a very good solution, but it's helped me plenty of times where i couldnt install Jakarta or the likes on a server and couldnt connect to it using sockets.
    Justin

  • [SOLVED]can't "rewind" command with holding arrows on keyboard.

    I hope to make myself as clear as I can: when I hold arrows on keyboards (in game for example) I can only move 1 square, when it should go until I release arrow.
    Same in console, I can't "rewind" command when holding arrow, I have to keep pushing it until it gets where I want it.
    Last edited by begbie (2010-08-11 10:45:09)

    you mean terminal history browsing? Well this isn't a solution to your problem, but you could always use bang commands or command history search, which has eliminated my use of the arrow keys.
    For your particular problem, what terminal emulator are you using? And what's the config?

  • When I open the Adobe Acrobat, Can I execute my command?

    Hi to all, my plug-in execute my command when I clicked my ToolButton, instead I want to execute my command when I'm opening Adobe Acrobat! How to That do?
    Thanks so much.
    P.s.: excuse for my english

    Hi,
    AVAppDidInitialise is a notification so you need to register that you would like you code called when the application sends out that notification.
    Here is a sample
    ACCB1 ASBool ACCB2 PluginInit(void)
    //Register for an event notification
    AVAppRegisterNotification(AVAppDidInitializeNSEL,
    gExtensionID,ASCallbackCreateNotification(AVAppDidInitialize,
    &myNotificationCallback), NULL);
    //Create a user-defined function that is invoked when Adobe Reader or Acrobat
    //has finished initializing
    ACCB1 void ACCB2 myNotificationCallback(void *clientData)
    AVAlertNote("Acrobat has finished initializing");
    HTH
    Malcolm

  • When i fire alter system switch logfile

    i got a problem in which,when i fire alter system switch logfile.it diden't execute,but the cursur just blink..
    why this is happening???
    with regards Alok
    thanks a lot....

    Perhaps you can problems with some Data Dictionary views. Apply this query and print here the answer:
    select * from v$sgastat where name='free memory';
    Joel Pérez
    http://otn.oracle.com/experts

  • On switching on, a message says 'Firefox is already running but not responding...........' then tells me to close it and restart but how can I close it when the page isn't yet displayed?

    When I switch on my computer I get the desktop then I try to click on Mozilla Firefox but get the message, 'Firefox is already running but not responding. To open a new window you must first close the existing Firefox process or resart your system.' I looked up how to close but I need to click on 'file' then 'exit'. How can I do that when I can't see the page yet? IE is working fine.

    See also [[Firefox is already running but is not responding]]

Maybe you are looking for

  • ADHOC  Query Authorization

    Hi Experts, How authorization can be assigned to a query created by PAAH transaction (adhoc query). If a query is created by particular user/user group, it should not be altered by other user / user group. Please advice.Thanks in Advance. Regards, IF

  • Upgrading from Office 2010 to 365

    Upgrading from Office 2010 Pro to 365 Pro Plus - I know you must uninstall 2010 and install 365 or can run them concurrently. Question is - if you uninstall 2010 and install 365, what settings are lost and what settings are retained? Outlook signatur

  • Apple computer being hacked

    need help what to do if anything

  • Difference between Provide - Endprovide.

    Hi experts can any one spot light on the significance of PROVIDE - ENDPROVIDE in LDB?  and what is the difference between LOOP - ENDLOOP and PROVIDE - ENDPROVIDE. Thanks in advance. vamsi.

  • S:ZMESS:021 Error while doing MIGO (GRN)

    Dear Guru, I am facing the problem in GRN error is "A:MESS:021" Please help to solve this problem. Thanks in advance. Raj.