• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Remotely restarting a machine using AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Remotely restarting a machine using AppleScript


  • Subject: Re: Remotely restarting a machine using AppleScript
  • From: Michael Shantzis <email@hidden>
  • Date: Mon, 07 Jul 2003 10:39:43 -0700

The correct way of doing such a thing in the OSX environment doesn't
involve applescript at all, but rather involves some unix programming.

Note that what you're trying to do is not uncommon. You have a server
that you want to ping periodically to see if it is down. If it is down,
you want to restart it (NOTE: rebooting your machine is most likely
unnecessary, just restarting your server should be sufficient).

So here's roughly what a unix solution to this would entail. You
would write a script (shell, perl, python) that does the following:

- runs 'ps' to see if the process for still running. Do a 'man ps' to
figure out what information you need to get out. You'll probably pipe
the output through 'grep' to figure out if the server is running.

- If it's not running, restart it. you can do this simply by
using the 'open' shell command (e.g. "open /Applications/Mail.app" will
start up mail).

How do you get this script to run? You put it into one of the
subdirectories of /etc/periodic (the dirs are daily, weekly, monthly)
to say how often you wish to run it. that's it!

For more information on those directories, type 'man periodic' from
your terminal.

- Michael

On Sunday, July 6, 2003, at 10:37 PM, Rob Werner wrote:

We are running a FileMaker Pro 6 server, but unfortunately FMPro
unexpectedly quits quite regularly. The service is quite important, so
obviously we would like to avoid downtime. I am looking into the
possibility of writing a script that would run on a different machine, and
monitor a webpage that would be served by FileMaker. If this page became
unavailable, this would indicate a crash and the script would remotely
reboot the FileMaker machine.

Anyway, is it possible to remotely reboot a machine using AppleScript? I
was think SSH or something like that. Something fairly robust, that would
reboot the machine regardless of what the system is doing. Any thoughts?

Cheers,

-Rob
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Remotely restarting a machine using AppleScript (From: Rob Werner <email@hidden>)

  • Prev by Date: Re: Print to PDF
  • Next by Date: Re: another Palm Desktop question: can memo categories be set?
  • Previous by thread: Re: Remotely restarting a machine using AppleScript
  • Next by thread: Re: Starting directory for 'choose file'
  • Index(es):
    • Date
    • Thread