This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 months ago.
The community reviewed whether to reopen this question 3 months ago and left it closed:
Original close reason(s) were not resolved
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(11)
尝试 Unison:http://www.cis.upenn.edu/~bcpierce/unison/ code
语法:
Unison 询问当文件不同时要做什么,但您可以使用以下接受默认(不冲突)选项的命令来自动化该过程:
unison -auto dirA/ dirB/
< >unison -batch dirA/ dirB/ 根本不问任何问题,并写入输出有多少文件被忽略(因为它们存在冲突)。
注意:我不再使用 Unison(我使用 NextCloud,它不能解决原始用例)。但请注意,
rsync
并非专为双向同步而设计,而unison
则适用。unison
可能有其缺陷(与任何其他软件一样)和缺陷。我很惊讶它现在似乎得到了积极的维护(上次我看的时候我想我认为它看起来已经死了),但我不确定现在的状态如何。我不需要双向文件同步器,因此可能有更好的选择。注 2:我现在出于某些目的使用 Mutagen。它仍然没有完全涵盖问题的用例,但它确实实现了双向同步。
Try Unison: http://www.cis.upenn.edu/~bcpierce/unison/
Syntax:
Unison asks what to do when files are different, but you can automate the process by using the following which accepts default (nonconflicting) options:
unison -auto dirA/ dirB/
unison -batch dirA/ dirB/
asks no questions at all, and writes to output how many files were ignored (because they conflicted).Note: I am no longer using Unison (I use NextCloud, which doesn't address the original use case). However, note that
rsync
is not designed for bidirectional sync, whileunison
is.unison
may have its bugs (as any other piece of software) and its wrinkles. I am surprised it seems to be actively maintained now (last time I looked I think I thought it looked dead), but I'm not sure what's the state nowadays. I haven't had the need to have a two-way file synchronizer, so there may be better options, though.Note 2: I am now currently using Mutagen for some purposes. It still doesn't cover the question's use case completely, but it does implement two-way sync.
我很惊讶还没有人提到Syncthing。多年来我一直使用它来同步我的手机、平板电脑和两台笔记本电脑。有一次,我还使用它向大约 600 公里外的家人发送 10 GB 的照片,直接从我的机器发送到他们的机器,而且速度非常快(尽管数据通过 Syncthing 的发现服务器路由以解决 NAT 问题)。我也曾尝试过 OwnCloud/NextCloud,但 Syncthing 更可靠,而且速度也更快。
I'm surprised no one has mentioned Syncthing yet. I have been using it for years to synchronize my phone, my tablet and my two laptops. One time I also used it to send 10 GB of photos to my family ~600 km away, straight from my machine to their machine, and it was incredibly fast (despite the data getting routed through Syncthing's discovery server to work around NAT issues). I also tried OwnCloud/NextCloud at some point but Syncthing has been much more reliable and, also, much faster.
由于最初的问题还涉及台式机和笔记本电脑以及涉及音乐文件的示例(因此他可能使用 GUI),我还要提到迄今为止最好的双向、多平台、免费和开源程序之一:< a href="http://freefilesync.sourceforge.net/" rel="nofollow noreferrer">FreeFileSync。
它基于 GUI,非常快速和直观,具有过滤和许多其他选项,包括远程连接、查看和交互式管理“冲突”(例如具有相似时间戳的文件)以及在双向传输、镜像和传输之间切换的能力。很快。
FreeFileSync 可以轻松同步同一网络上的两台计算机,也可以同步不同网络和远程网络上的两台计算机。
我还将其中一台笔记本电脑与安装了 Samba 并共享其目录之一的 Linux 服务器同步。
Since the original question also involves a desktop and laptop and example involving music files (hence he's probably using a GUI), I'd also mention one of the best bi-directional, multi-platform, free and open source programs to date: FreeFileSync.
It's GUI based, very fast and intuitive, comes with filtering and many other options, including the ability to remote connect, to view and interactively manage "collisions" (in example, files with similar timestamps) and to switch between bidirectional transfer, mirroring and so on.
FreeFileSync can easily sync two computers on the same network and also sync two computers on different and remote networks.
I have also synced one of these laptops with a Linux server with Samba installed and sharing one of its directories.
您还可以尝试 bitpocket:https://github.com/sickill/bitpocket
You could also try bitpocket: https://github.com/sickill/bitpocket
试试这个,
我刚刚测试了这个,它对我有用。我正在 Windows7(使用安装了 rsync 软件包的 cygwin)和 FreeNAS 文件服务器(FreeNAS 在预安装了 rsync 软件包的 FreeBSD 上运行)之间进行 2 路同步。
Try this,
I just test this and it worked for me. I'm doing a 2-way sync between Windows7 (using cygwin with the rsync package installed) and FreeNAS fileserver (FreeNAS runs on FreeBSD with rsync package pre-installed).
您可以使用 Osync: http://www.netpower.fr/osync ,它是基于 rsync 的智能删除传播。它还具有多种选项,例如恢复暂停的执行、软删除和时间控制。
You might use Osync: http://www.netpower.fr/osync , which is rsync based with intelligent deletion propagation. it has also multiple options like resuming a halted execution, soft deletion, and time control.
您可以尝试 csync,它是 owncloud。
You could try csync, it is the sync engine under the hood of owncloud.
我现在使用 SparkleShare https://www.sparkleshare.org/
适用于 Mac、Linux 和 Windows。
I'm now using SparkleShare https://www.sparkleshare.org/
works on mac, linux and windows.
Rclone 就是您正在寻找的。 Rclone(“云存储的 rsync”)是一个命令行程序,用于在不同的云存储提供商(包括本地文件系统)之间同步文件和目录。 Rclone 以前称为 Swiftsync,自 2013 年起推出。
Rclone is what you are looking for. Rclone ("rsync for cloud storage") is a command line program to sync files and directories to and from different cloud storage providers including local filesystems. Rclone was previously known as Swiftsync and has been available since 2013.
我不确定它是否适用于两次同步,但要使 --delete 工作,您还需要添加 --recursive 参数。
I'm not sure whether it works with two syncing but for the --delete to work you also need to add the --recursive parameter as well.
我构建了一个轻量级、易于使用且易于配置的守护进程,名为 livesync,请在 查看它https://github.com/brauliobo/ruby-livesync
它依赖 pyinotify 来观看并从远程同步到本地,重用相同的持久 ssh 连接
I've built a lightweight, simple-to-use and easy to configure daemon called livesync, check it out at https://github.com/brauliobo/ruby-livesync
It relies on pyinotify to watch and sync from remote to local, reusing the same persist ssh connection