Skip to content

Instantly share code, notes, and snippets.

@codeasashu
Created January 26, 2017 00:23
Show Gist options
  • Save codeasashu/51ba95976d7cf99318e2e7729675d9f5 to your computer and use it in GitHub Desktop.
Save codeasashu/51ba95976d7cf99318e2e7729675d9f5 to your computer and use it in GitHub Desktop.

Use rsync to sync your project to server. Use syncd to automate it.

attaching installation process

  1. Install rsync

  2. Get syncd from https://github.com/codeasashu/syncd.git (branch: direction)

  3. copy syncd and watch.sh to /usr/local/bin so you can execute it directly in terminal cp syncd /usr/local/bin cp watch.sh /usr/local/bin

  4. Create your project directory anywhere on system. For ex- I created project abc in /var/www/html

  5. in /var/www/html/abc, create syncd.conf(use the one from clone above)

  6. Modify SSH access and put any key file if you use for authentication.

  7. First set REMOTE_TO_LOCAL=true to fetch all the files and data from remote to local

  8. Set REMOTE_TO_LOCAL=false now. Start editing.

  9. When finished editing, just open terminal and run these:

cd /var/www/html/abc
syncd run

It will update your changes to remote.

NOTE: Remember to have backup of remote files before using this process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment