News for hackers. Stuff that matters.
Re:Show HN: Sync.js – Upload changed local files to remote s... by dansimau on Monday July 22, 2013 @10:17AM (#6083764)
A simpler (and more efficient) equivalent to this script would be this one-liner:

    while true; do rsync -azP $PWD/ <remote>:$PWD/; sleep 2; done
Or even better: https://code.google.com/p/lsyncd/

lsyncd uses inotify/fsevents, meaning you don't have to traverse the filesystem to poll for changes.

Re:Show HN: Sync.js – Upload changed local files to remote s... by serkanyersen on Monday July 22, 2013 @10:21AM (#6083795)
Nice suggestion. I didn't use inotify because macosx doesn't have it and nodejs equivalents eats too much CPU for some reason. I tried to make it as simple as possible.
Re:Show HN: Sync.js – Upload changed local files to remote s... by res0nat0r on Monday July 22, 2013 @11:43AM (#6084438)
There are some hoops to jump through but I've got lsyncd working on my Mac. I think you have to compile it with fsevents. I think the README actually details what you need to do.
Re:Show HN: Sync.js – Upload changed local files to remote s... by skimmas on Monday July 22, 2013 @10:29AM (#6083857)
running rsync every 2 seconds on a medium/large project might be a little intense since it compares each file looking for changes.
Re:Show HN: Sync.js – Upload changed local files to remote s... by dspillett on Monday July 22, 2013 @10:53AM (#6084003)
It only needs to compare actual file contents if the file properties (dates, size, ownership, rights) have altered with the options used in this example so it would only need to perform directory reads in the case of no such changes. Of course for a very large project this could still be significant, but much less so.