Giter Site home page Giter Site logo

guard-remote-sync's Introduction

#Guard::RemoteSync Build Status Dependency Status Code Climate Gem Version

Install

Please be sure to have Guard installed before continuing.

Please be sure to have the rsync command in your path.

It's recommended that you set up a ssh key if you're going to do remote syncing. Alterantively your can use a password file as per rsync default option --password-file=FILE, the drawback with this is you might commit your information to the repo, and that ain't no good. Lastly, you can just type in your password everytime, but that's too much work. Add a ssh key!

Install the gem:

$ gem install guard-remote-sync

Add guard definition to your Guardfile by running this command:

$ guard init remote-sync

Usage

Please read Guard usage doc

Guardfile

Any directory you need to rsync

guard 'remote-sync',
        :source => ".", 
        :destination => '/export/home/{username}/tmp', 
        :user => '{user}',
        :remote_address => '{address}',
        :verbose => true, 
        :cli => "--color", 
        :sync_on_start => true do
  
  watch(%r{^.+\.(js|xml|php|class|config)$})
end

Please read Guard doc for more information about the Guardfile DSL.

Options

There are only two required options

guard 'remote-sync', :source => '.', :destination => './tmp' do
        # ...
end

Syncing to a remote machine required additional options

guard 'remote-sync', 
        :source => "."                      # the directory to start the remote sync guard in
        :destination => '/export/home/user' # the directory to sync to
        :user => "someone"                  # the user to user ex: {USER}@somehost.com
        :remote_address => 'company.com'    # the remote address ip or url
        do
                # ...
end

Using your own rsync command. This bypasses all validations, etc.

guard 'remote-sync', :cli_options => 'rsync -Carv . [email protected]:/export/home/user' do
        # ...
end

List of available options:

Most of these options are human readable and correspond to rsync's options. Long options are used wherever possible to be more verbose

:source => nil                      # the source directory to start in
:destination => nil                 # the directory to sync to
:user => nil                        # the user to use if remote syncing to another machine
:remote_address => nil              # the remote address to the other machine ip|url
:remote_port => nil                 # the port to use for ssh connetions
:ssh => false                       # see rsync options : "$ man rsync"
:auth_key => nil                    # the identity file to use for ssh authentication
:cli_options => nil                 # used if you want to pass your own rsyn command
:archive => true                    # see rsync options : "$ man rsync"
:recursive => true                  # see rsync options : "$ man rsync"
:verbose => true                    # see rsync options : "$ man rsync"
:delete => true                     # see rsync options : "$ man rsync"
:include => nil                     # see rsync options : "$ man rsync"
:include_from => nil                # see rsync options : "$ man rsync"
:exclude => nil                     # see rsync options : "$ man rsync"
:exclude_from => ".rsync-filter"    # see rsync options : "$ man rsync"
:progress => true                   # see rsync options : "$ man rsync"
:sync_on_start => false             # rsycn when the guard starts instead of waiting for a watcher to trigger guard
:dry_run => false                   # see rsync options : "$ man rsync"
:cvs_exclude => false               # see rsync options : "$ man rsync"
:password_file => nil               # see rsync options : "$ man rsync"
:timeout => 9999                    # see rsync options : "$ man rsync"

Development

Testing

Please run bundle exec rake spec to test the source

Author

Patrick H. McJury

guard-remote-sync's People

Contributors

danielpanzella avatar dblacka avatar pmcjury avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.