Run ruby script remotely

Discussion in 'Ruby' started by Melb, Apr 21, 2014.

  1. Melb

    Melb Guest

    Hi,
    I have a ruby script which I tested locally on my machine,
    I want to execute it on three remote servers, Is there a way to execute it remotely without connecting to every machine and executing it
    Or Can I use a master server to run the script on the three machines, by connecting to only one server

    rgds
     
    Melb, Apr 21, 2014
    #1
    1. Advertisements

  2. Melb

    Romiras Guest

    Romiras, Apr 22, 2014
    #2
    1. Advertisements

  3. Melb

    Melb Guest

    Yes, I am able to deploy ruby(not rails) script to all servers
    but how can I run it without connecting to servers
    Can capistrano help to run it?
    How can I control the script start/stop...
     
    Melb, Apr 22, 2014
    #3
  4. Melb

    Doug Hall Guest

    If it's just a script that simply needs to be triggered to run at will, then Capistrano is your best bet. If your script doesn't change much, and can simply be run at a specific interval or time, then just set up cron on eachserver to do the job for you. Capistrano is meant to simplify tasks that administrators have to do on their servers frequently. With Capistrano, you can set up a task that talks to multiple servers at a time.

    You'll need to connect to the servers through Capistrano, which runs on YOUR machine. However, you'll need permissions on each server to be able to upload and execute your script. Also, you'll need the same version of ruby (and gems) installed on each server.

    You'll probably need at least two custom Capistrano tasks: one to upload the script itself, which you'll use whenever the script is modified, and one to "execute" it on the remote servers.
     
    Doug Hall, Apr 24, 2014
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.