Git Product home page Git Product logo

sshync's Introduction

sshync

Auto-sync files or directories over SSH using fs.watch().

would you like to use key-based authentication? [yes/no]

  • yes – if they do not already exist, SSH private/public keys will be generated with ssh-keygen to ~/.ssh/sshync and the public one moved to ~/.ssh/authorized_keys on remote host (assumes you have access). Files will be transferred asynchronously.
  • nofiles will be transferred synchronously and you will have to enter password every time a file changes. files will now be transferred asynchronously and you will now only have to enter password once when sshync is run.

Utilizes simple caching to avoid unnecessary file transfers and to continuously show size difference.

Ignore paths by adding them, one per line, to a file named .sshyncignore in the root source folder.

Install

$ npm install sshync -g

Usage

# initialize sshync
# (you might have to type password to transfer public key to remote host)
$ sshync <user@ip[:port]> <source> <destination>
          source:       local source folder.
          destination:  remote destination folder.

Example

First time run output:

$ sshync [email protected] sshync.js /root/sshync/sshync.js
would you like to use key-based authentication? [yes/no] yes
transferring public key to ~/.ssh/authorized_keys
[email protected]'s password:
/Users/xxx/.ssh/sshync.pub => ~/.ssh/authorized_keys 0.4kB (+406)
connected to [email protected]
syncing sshync.js to /root/sshync/sshync.js
sshync.js => /root/sshync/sshync.js 6.2kB (+6327)

# ... edit sshync.js ...
sshync.js => /root/sshync/sshync.js 6.2kB (+1)

Second time run output (no password needed):

$ sshync [email protected] sshync.js /root/sshync/sshync.js
would you like to use key-based authentication? [yes/no] yes
connected to [email protected]
syncing sshync.js to /root/sshync/sshync.js
sshync.js => /root/sshync/sshync.js 6.2kB (+6327)

# ... edit sshync.js ...
sshync.js => /root/sshync/sshync.js 6.2kB (+1)

If you use this project and would like to see it grow, please consider supporting a fellow hacker by donating to 1JiNbQYiozZZU8J39nbrY9YHSuzkFpivNU.

sshync's People

Contributors

iamthechad avatar mateogianolio avatar maxdignan avatar rdancer avatar

Stargazers

 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.