TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

28 点作者 serkanyersen将近 12 年前

5 条评论

sambeau将近 12 年前
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 未加载
dansimau将近 12 年前
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 未加载
skimmas将近 12 年前
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.
JimmaDaRustla将近 12 年前
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.
vegardx将近 12 年前
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 未加载