我需要将文件夹从 linux 同步到 windows ,windows 始终作为 linux 的一个镜像备份,这个需求本来只要是有有增量同步功能以及删除目标目录中存在但原目录中不存在的文件的功能的软件就行,但我会经常把一些大文件从 a 目录移动到 b 目录,我希望文件同步软件能做到在 windows 上也把这个文件从 a 目录移动到 b 目录,而不是把 a 目录下的这个文件删除掉,然后再重新把文件从 linux 的 b 目录拷贝到 windows 的 b 目录
![]() |
1
terence4444 31 天前
Dropbox 可以做到,目前 Linux 下没有什么好用的 Onedrive 客户端
|
2
nullico 31 天前 ![]() syncthing 感觉可以啊
|
3
nocmt 31 天前
微力同步,简单快捷
|
![]() |
4
zjsxwc 31 天前 via Android ![]() 传统的 rsync 不行吗,我觉得 rsync 不会傻到会把 move 同步成 delete© 。
|
![]() |
5
paperseller 31 天前 via iPhone
坚果云也行
|
6
psllll 31 天前
seafile
|
8
wniming OP |
![]() |
9
Jakarta 31 天前 via Android
syncthing 可以
|
10
wniming OP ![]() @zjsxwc 刚才测试了一下两台 linux 机器用 rsync 同步目录,结果是 rsync 不会 move ,而是 delete© ,用的是下面的命令:
rsync -av --delete test rsync://10.0.0.3/shm/test |
![]() |
11
SenLief 31 天前 via iPhone
rsync -av --remove-source-files
|
12
wniming OP |
14
wniming OP @SenLief 我需求就是 linux 通过 mv 命令移动文件后,再通过某种软件把目录同步到 windows ,windows 当然也是要移动,但是我用 2 台 linux 测试
rsync -av --remove-source-files test rsync://10.0.0.3/shm/test 这条命令,结果就是执行完后执行这条命令的那台机的 test 目录下的所有文件都被删除了,我想要的效果是软件不会更改我源目录的文件,只会更改 10.0.0.3 这台目标机器上的目录 |
15
Jacksu 31 天前 ![]() 要移动功能,只有 seafile/nextcloud 这种服务端软件(都有专门的数据库)可以做到,rsync 又不会在线监视你的文件变化,它只是每次发起同步的时候比对文件信息而已。
|
![]() |
16
flynaj 31 天前 via Android
syncthing 全平台同步软件,不过你需要的那个功能估计没有软件实现,特别是异构系统。
|
![]() |
17
BeautifulSoap 31 天前 via Android
ls 那么多推荐 syncthing 的 lz 就是不高兴试一下
|
18
wniming OP @BeautifulSoap 还在试。。。。
|
19
hysjw 31 天前
只推荐 syncthing
|
![]() |
20
czhu 31 天前
插个队 syncthing 和 resilio sync 怎么选?
看了一圈 似乎 resilio rync 更成熟,pro 版本也免费了 |
21
jokerhyc 31 天前
|
23
neutrino 30 天前 via Android
@terence4444 https://github.com/abraunegg/onedrive 这个蛮好用的,放 docker 里
|
![]() |
25
zjsxwc 30 天前
@zjsxwc #24 rsync -av --inplace --append --no-whole-file test rsync://10.0.0.3/shm/test
|
![]() |
26
w292614191 30 天前
nextCloud
|
27
dufldylan1 30 天前
syncthing 用五年了,不只双端,支持多台设备组网,互相同步。掉线一个也不碍事
|
![]() |
28
MoeDisk 30 天前
自己写一个吧~
|
![]() |
29
lazyyz 30 天前
一直用的 syncthing
|
![]() |
30
liyafe1997 30 天前 via Android
你要找的就是 syncting ,最无敌的去中心化&能穿透内网&开源跨平台的文件同步工具。
用了好多好多年了,在 N 个设备上配置好后,简直就是个分布式网盘。 |
![]() |
31
xiaoz 30 天前
Seafile ,全平台。
|
32
bianjp 30 天前
syncthing 只适合两个设备同时在线的场景,感觉用处不大。
比如办公电脑和家里的个人电脑,基本不会同时在线;笔记本安装的双系统也不会同时在线。 |
33
swordsmile 30 天前
可以试试 lsyncd 的 direct 模式,把 Windows 目录挂载过来。
以下是 Debian 下的配置,仅供参考 ``` apt install lsyncd mkdir /etc/lsyncd/ touch /var/log/lsyncd.log touch /var/log/lsyncd.status cat << 'EOF' > /etc/lsyncd/lsyncd.conf.lua settings { logfile = "/var/log/lsyncd.log", statusFile = "/var/log/lsyncd.status", insist = true, statusInterval = 10 } sync { default.direct, source = "/tmp/src", target = "/tmp/dst", --delete = true, --delay = 60, maxProcesses = 1 } EOF ``` |
34
HrOice 30 天前
localsend 吧,多设备的
|
35
chengzigua 30 天前
我在 Windows 上有 git ,然后用 Git Bash 就可以运行 Linux 命令行了,再去搜一下“Windows Git Bash 里使用 rsync”之类的很多教程。我就是用这方法来同步云服务器上到本地电脑的非常好用,还能写 shell 脚本非常 nice 。
|
36
mumuxiaoqiang 30 天前
scp
|
![]() |
37
Aalen 30 天前
搞个黑裙 用群辉的网盘同步
|
38
ala2008 30 天前
syncthing 很强大,还开源
|
39
hnliuzesen 30 天前
Qsync 😅
|
![]() |
40
SenLief 30 天前 via iPhone
@wniming 我大概懂了,你想把操作也同步,这个 rsync 没办法,它只监控文件变化,如果想达到相同效果,需要两台机器都执行这个命令才行。
|
![]() |
41
noErr 30 天前
WinSCP 啊
|
![]() |
42
polarwolf 30 天前
free file sync 和 kopia 也可以看一下
|
![]() |
43
saranz 30 天前
用 Wine 安装 oneDrive 感觉也是可以。
|
44
1252603486 30 天前
syncthing 最好用
|
45
jackey007 30 天前
不是很多人同时用的话,nextcloud 还是很稳定的
|
![]() |
46
kaizceo8 30 天前
windows 安装 minio linux 使用 mc
|
47
linuxsir2020 30 天前
歪个楼, 放在共享目录里操作 :)
|
![]() |
49
iamjs 30 天前
syncthing
|
50
Jericho112 30 天前
windows 开一个文件夹共享,打开编辑权限,局域网内 linux 连过去?
|
51
wniming OP 测试了一下 syncthing ,基本满足需求,确实能在源目录(设置为仅发送的目录)的文件重命名或移动到其它目录时在目标目录(设置为仅接收的目录)上做同样的操作,唯一的问题是它基本上要求目标目录在第一次同步前是一个空目录,我测试过程中遇到两台机同步后状态都是“up to date”,但是目标目录中原来有的一些源目录中没有的文件没有被删除。
syncthing 如果能让两个在第一次同步之前都非空的目录同步就好了,比如第一次同步之前先计算一下源目录和目标目录的所有文件的 md5 ,如果有 md5 相同的文件就不要从源目录拷贝,直接在目标目录移动或重命名,然后把存在在目标目录中但不存在在源目录中的文件删除掉,然后再把源目录中存在但目标目录中不存在的文件拷贝到目标目录,这样就能在目标目录已经有源目录的大部分文件,但是文件名和路径跟源目录不一样时发挥特别大的作用。 |
53
meeliao 30 天前
俺用的 syncthing ,体验还不错
|
![]() |
54
slrey 30 天前 ![]() freefilesync 是这个功能的。
它的官网是这么写的。 Detect Moved Files FreeFileSync is able to detect moved files and quickly apply the same move on the target side during synchronization instead of a slow copy and delete. To makes this work, Use database file to detect changes must be checked and the file system must support file IDs. Note: Detection of moved files is not yet possible when synchronizing a folder pair for the first time. Only beginning with the second sync the database files are available to determine moved files. Detection is not supported on file systems that don't have (stable) file IDs. Most notably, certain file moves on FAT file systems cannot be detected. Also, protocols like SFTP do not support move detection. In these cases FreeFileSync will automatically fall back to "copy and delete". |
![]() |
55
skiy 30 天前
syncthing +1
如果是单文件,就用 LocalSend |
56
joyxubing966 30 天前
@bianjp 卧槽 我一直以为是我使用问题
|
![]() |
57
xloong 30 天前
@bianjp #32 可以手机也安装 syncthing, 充当中间传输的中转站, 我就这么干的
而且手机相册直接设置同步到电脑, 当做备份, 去年 9 月份手机炸了, 基本不慌, 重要的文件电脑上都有备份 @joyxubing966 #56 |
58
stevenshum 29 天前
Samba 呀,Samba 最大的功能就是可以用于 Linux 与 windows 系统直接的文件共享和打印共享。
|
59
BKElectroCloud 29 天前 ![]() @czhu 一直在用 resilio rync ,近期根本打不了洞,没法提供广域网的文件同步了,唯一优势只剩下图形化多端操作简易了。
|
![]() |
60
louisyoungx 29 天前
这种场景真该买个 NAS 吧
|
61
szguan 29 天前
我用 freefilesync ,曾经特意观察了这个使用场景,如果 rename 文件夹名,它会 move ,而不是删除再新增。符合你的要求
|
![]() |
62
xyfan 29 天前 ![]() @wniming 你这个需求就不是正常场景下的同步需求,我觉得你应该自己写个脚本把目标文件夹调整到和源文件夹相同。就把你这段话送进 cursor ,需求描述的清楚,代码逻辑应该也不复杂。
|
![]() |
63
czhu 29 天前 via iPhone
@BKElectroCloud 在用 syncthing 这个配置真是有点烦
|
![]() |
64
hanssx 26 天前
insync onedrive ,当然少量可以,大量不靠谱。
|
![]() |
65
hanssx 26 天前
我建议你直接 nas
|