sshync icon indicating copy to clipboard operation
sshync copied to clipboard

sync not triggered in filechanges in subdirectories

Open MiniGod opened this issue 9 years ago • 3 comments

With the following folder structure

├── package.json
└─┬ lib/
  └── index.js

When modifying lib/index.js, nothing happens in sshync. When modifying package.json, both files are synced.

Since both files are synced when I modify index.js I assume it is fs.watch that doesn't catch the recursive files (although it is set to do so in the latest version?)

Using version 1.1.1 and tested with node v0.10.46, v4.4.7, and v6.3.0

MiniGod avatar Jul 12 '16 13:07 MiniGod

Hey, @MiniGod. Thank you for reporting the issue.

In certain environments fs.watch can be problematic, see https://nodejs.org/docs/latest/api/fs.html#fs_caveats

I will look this up and maybe switch to something more stable when I have time.

mateogianolio avatar Jul 12 '16 15:07 mateogianolio

This occurred on Ubuntu 12.04. I have not tested this on other distros or OSes.

Looking forward to a potential fix!

MiniGod avatar Jul 12 '16 18:07 MiniGod

FYI, I'm not using this module any more, but stole the rsync command from this module (thanks!).

I do this now with nodemon:

# nodemon -x rsync -- -avuz --exclude .git --exclude-from .gitignore <source> <dest>
# example:
nodemon -x rsync -- -avuz --exclude .git --exclude-from .gitignore ./ [email protected]:/user/ubuntu/some_project/

MiniGod avatar Sep 16 '16 14:09 MiniGod