TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Sync.js – Upload changed local files to remote server

28 pointsby serkanyersenalmost 12 years ago

5 comments

sambeaualmost 12 years ago
At some point in their career every programmer tries to write their own rsync. I must have written at least three — none of which are anywhere near as clever and reliable as rsync.<p>Why do we do this?
评论 #6084005 未加载
评论 #6084032 未加载
评论 #6083827 未加载
评论 #6083825 未加载
dansimaualmost 12 years ago
A simpler (and more efficient) equivalent to this script would be this one-liner:<p><pre><code> while true; do rsync -azP $PWD&#x2F; &lt;remote&gt;:$PWD&#x2F;; sleep 2; done </code></pre> Or even better: <a href="https://code.google.com/p/lsyncd/" rel="nofollow">https:&#x2F;&#x2F;code.google.com&#x2F;p&#x2F;lsyncd&#x2F;</a><p>lsyncd uses inotify&#x2F;fsevents, meaning you don&#x27;t have to traverse the filesystem to poll for changes.
评论 #6083795 未加载
评论 #6083857 未加载
skimmasalmost 12 years ago
While I can see how this can be useful, that means you&#x27;ll constantly breaking things on the development server while you&#x27;re writing code&#x2F;testing. When working on projects alone I prefer to have a simple script that runs rsync with some predefined settings whenever I want to upload changes for someone to see (I also have an option to upload database). For multi developers environments I guess git would be the way to go.
JimmaDaRustlaalmost 12 years ago
For development, I run my VMs with Samba so that I can use whatever local tools to edit files remotely.<p>Edit: I like the idea - make something you need, not struggle with overly complicated sync algorithms&#x2F;apps to achieve the simple result.
vegardxalmost 12 years ago
Because we have git, and with hooks also automatic deployment. Seriously, this is a really bad idea, and the only reason I can find to why we don&#x27;t see many tools like this is because they break stuff. All the time.
评论 #6083725 未加载