auto shutdown elastix

Discussion in 'General' started by waraltca, Mar 2, 2010.

  1. waraltca

    Joined:
    Nov 5, 2009
    Messages:
    17
    Likes Received:
    0
    hi guys...

    Does anybody knows how to shutdown elastix automatically?

    Thanks in advance!
     
  2. Amphibian

    Joined:
    Sep 8, 2009
    Messages:
    1,128
    Likes Received:
    2
    Welcome waraltca,

    What are you trying to accomplish? Time shutdown or just a shutdown when needed?

    In other words, Do you need to know how to shut the machine down from GUI interface? Select "System" tab, then select "Shutdown", then select either to reboot or halt.

    If you need it to shut down at certain times, like when everyone leaves the office for the day, then write a cron script to do such.

    If you have production machine in operation, either for office or home, I don't understand why you have need to shut down regularly, just leave it running, especially if it is operating on a new machine of todays quality, doesn't draw that much power..

    Search on here or the internet for a cron script for shut down.



    Hope this helps

    Amphibian
     
  3. danardf

    Joined:
    Dec 3, 2007
    Messages:
    8,069
    Likes Received:
    12
    Hi.

    Yes of course, with the crontab.
    • - reboot or
      - shutdown -r now
    for halting,
    • - halt or
      - shutdown -h now.

    Remember that you must put the absolut folder with the command.
    For example:
    • - For reboot, put /usr/bin/reboot ..etc
      - For shutdown -r now, put /sbin/shutdown -r now

    Regards
     
  4. waraltca

    Joined:
    Nov 5, 2009
    Messages:
    17
    Likes Received:
    0
    thanks guys for answering...

    What I need is to shutdown the server after everyone has gone. That's for security risk. We are a small office (growing up to fast:cheer: ) so by the way, while we get more infrastructure to let the servers online all night.

    Anyway, I appreciate you help. Any suggestion about a place to find how to make a cron script?

    Thanks again.!
     
  5. rafael

    Joined:
    May 14, 2007
    Messages:
    1,454
    Likes Received:
    1
    You can acomplish this in two ways.

    Run the command
    Code:
    shutdown -h now
    
    In a cron job that would shoutdown the server everyday at the same hour.

    Other alternative could be to add the following line in /etc/rc.local

    Code:
    shudown -h 22:00
    
    That way the server would shutdown at 22:00, you can change the time to fit your needs.

    the following commands should be useful:
    Code:
    man shutdown
    man cron
    man at
    
    Best regards,

    Rafael
     
  6. cassioac

    Joined:
    Nov 14, 2009
    Messages:
    10
    Likes Received:
    0
    Hi guys...

    I remember trixbox had a nice feature on it's GUI, that if selected, stopped accepting calls and restarted the server after there were none active calls.

    Is there anyway to do this in elastix?

    Regards..
     
  7. beerhere

    Joined:
    May 14, 2010
    Messages:
    13
    Likes Received:
    0
    in the web interface of elastix you can't program a shutdow (version 1.6, maybe in the future.....). Only shutdown right now.

    But in script programed with crone you can use this line:

    "asterisk -rx stop gracefully" in your script - gracefully shut down Asterisk, i.e. stop receiving new calls and shut down at empty call volume

    or you can use:
    "asterisk -rx stop when convenient" - shut down Asterisk at empty call volume

    the next line in the script to power off the server:
    "shutdown -h now"
     
  8. eiger3970

    Joined:
    Apr 29, 2009
    Messages:
    112
    Likes Received:
    0
    rafael,
    when I type the command, nothing happens.
    I open putty which takes me to:
    [root@mydomainname ~]#

    I then type in:
    /etc/rc.local

    Putty then shows me the error:
    eth0: error fetching interface information: Device not found
    STARTING ASTERISK
    Asterisk is already running
    STARTING FOR SERVER
    FOP server is already running
    [root@mydomainname ~]#

    Please help so I can shutdown my Elastix server automatically every night at 2200.
    Also, how can I cancel the command as I will run a test with 5 minutes to wait after entering the command.
     

Share This Page