Skip to content

Monitors a local directory for changes and syncs them to a remote machine via SSH using rsync. It works on unix based systems, including Macintosh.

License

Notifications You must be signed in to change notification settings

JasonRaveling/watch-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

watch-sync.sh

Monitors a local directory for changes and syncs them to a remote machine via SSH using rsync. It works on unix based systems, including Macintosh.

The script will check for the existence of a config file (i.e. .watchsyncrc.sh) for setting default settings. Once default settings have been confirmed or overridden, the script continues watching and syncing until you close it. An SSH connection is made each time changes are detected, files are synced, and the connection is closed.

Requirements

The following packages are required.

  • rsync
  • sshpass
  • inotify-tools (linux only)
  • fswatch (macintosh only)

Using the script

Make watch-sync.sh executable, run it, then respond to the prompts. This may look like the following.

chmod +x watch-sync.sh # Make it executable
./watch-sync.sh # Run it.

Default options can be configured as variables at the top of the script or by adding the .watchsyncrc.sh file to the directory where you will be running watch-sync.sh.

About

Monitors a local directory for changes and syncs them to a remote machine via SSH using rsync. It works on unix based systems, including Macintosh.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages