V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
lfk0000
V2EX  ›  分享发现

在 Windows 上使用 SyncToy 实现 GoogleDrive OneDrive Dropbox iCloudDrive Syncthing 之间的同步

  •  
  •   lfk0000 · 2017-06-29 05:54:41 +08:00 · 3244 次点击
    这是一个创建于 2487 天前的主题,其中的信息可能已经有所发展或是发生改变。
    之前,我的主力同步盘是自建的 Syncthing ,跑在 10 刀一年的搬瓦工上,以及家里电脑、单位电脑,笔记本*2,安卓手机*n
    上面放了一些个人的和工作上的文件、文档(低保密等级,低隐私级别)
    用了一两年,同步速度稳定性都也还可以
    直到我入了个 16G 的 iPhone,就开始尴尬起来了。。。

    一是 iOS 没 Syncthing,二是我也没那么多容量来做离线离线储存
    所以就转向云储存在线编辑,然而 google sheet 之类的在线编辑器自身就有 200 多 M。。。(我可以吐槽下 iOS 的软件为啥这么大么

    所以我就去找了几个自身体积很小的编辑器,但是,他们各自支持的网盘都不同。。。有的只支持 Dropbox,有的只支持 iCloud、etc。。。

    这不坑爹么,还能不能好好的同步了。。。

    本来想的是用软连接把 Syncthing 的同步文件夹映射到 GoogleDrive OneDrive Dropbox iCloudDrive 各自的同步目录
    但是咨询了一下朋友,他说有的同步盘监视不到软连接的文件变化,得手动重启进程,有的盘直接不支持软连接。。。。
    本来都打算放弃了,然后突然想到,既然不支持软的,我就来硬的呗,每个同步盘复制一份不就得了!

    于是翻出珍藏的 SyncToy -一款微软出品的免费的本地文件夹双向同步软件
    把各个文件夹都添加进去了:

    结构关系是这么样子的:


    这里有 3 种同步模式:

    第一个 Synchronize 是双向同步,第二个 Echo 是单向同步(左到右),第三个是增量(左到右只增加不删除)


    我先跑了一遍 Echo (注意需要自行设置过滤的子文件夹和忽略的后缀名、系统文件、隐藏文件)
    然后等着各个网盘完成同步,千万记得等他们全部上传完了,然后才能再去设置第二台电脑,不然会有各种文件冲突、重复。。。。

    然后再把 Echo 改成 Synchronize 的时候,要多点几次 Preview 预览下,确定是否在抽风,如果有大量需要 Overwrite 的文件,说明肯定抽风了,检查文件总大小、修改时间,用 FastCopy 的 Sync 功能去修复下(记得在 FastCopy 里面过滤 SyncToy_*)
    我才不会告诉你我尝试解决两台电脑同时上传网盘的抽风用了多久呢。。。。

    下面演示下双向同步效果
    需要解释一下,由于 SyncToy 本来只是作为两个文件夹的双向同步用的,我现在是用来 5 个文件夹在彼此双向同步。。。。(有点难为 SyncToy 了
    所以,大概是这么个情况:我建立了一个主文件夹的概念,既 Syncthing 的文件夹
    从这个文件夹同步到其他网盘只需要一步,而从网盘 A 同步另外网盘 B 就需要跑两次全部同步(第一次从网盘 A 同步到 Syncthing,第二次从 Syncthing 同步到网盘 B )
    如果不这样的话,需要建立非常多个同步规则


    所以。。。还是用主文件夹来中转一次吧,跑两次就跑两次呗,反正是电脑跑,设文件夹得我手设。。。


    这是在 Syncthing 目录下新建文件之后同步将会发生的事情:


    这是在网盘目录下新建文件之后,第一次同步将会发生的事情:


    这是在网盘目录下新建文件之后,第二次同步将会发生的事情:


    这是在网盘目录下删除文件之后,第一次同步将会发生的事情:


    这是在网盘目录下删除文件之后,第二次同步将会发生的事情:


    软件本身不带自动同步,可以添加 计划任务 来自动同步。。。。(可以的这很微软
    参见软件帮助文档:

    Schedule SyncToy

    While you do not have to schedule SyncToy to use it, some users may find it helpful to schedule recurrent SyncToy runs. Perhaps you have a folder pair that takes a long time to sync and you want to run SyncToy in the middle of the night, for example.

    SyncToy does not provide a user interface to schedule folder pairs to run at designated times. However, there is a method to schedule tasks using the Microsoft<sup>©</sup> Windows<sup>©</sup> operating system.

    Windows Vista/ Win7

    To schedule a task using the operating system:

    1. From the Start menu, select All Programs - Accessories - System Tools - Task Scheduler.
    2. Select Create Basic Task in the Actions pane on the right.
    3. Add a Name and Description and select Next.
    4. Choose when you want the task to start and select Next.
    5. Choose date/times (if applicable) to run task and select Next.
    6. Choose Start a Program option and select Next.
    7. Select Browse and locate the SyncToyCmd.exe.
    8. Type "-R" in the Add Arguments textbox. – R all by itself will run all folder pairs that are active for run all. If you want to run just a single folder pair, add – R “ My Pair ” to the end of the command line. <label>Note:</label> If the folder pair name contains a space, surround it with quotation marks, as the example above shows. For another example, assume that SyncToy is in the folder named C:\Program Files\SyncToy 2.1\ and that you want to run a folder pair named "My folder pair." Enter the command line as follows, including the quotation marks: "C:\Program Files\SyncToy 2.1\SyncToyCmd.exe" -R "My folder pair." Note that there are two sets of quotation marks in this case: one is around the path to the SyncToy program file and the other surrounds the folder pair name. 
    简单的说就是找到安装文件夹里的 SyncToyCmd.exe,后面加 -R 就是全部同步,后面加 -R "同步任务名称" 就是部分同步



    PS:iCloud Drive 默认文件夹在 C 盘 user 文件夹里,可以使用 mklink 把他弄出来:mklink /J "C:\Users\xkk\iCloudDrive" "D:\Sync\iCloud"

    PS2:妈蛋我有一个 iCloud 文件夹还在抽风。。。好像是文件时间戳的问题,不管了睡觉了明天再弄。。。

    PS3:自动开启同步之后注意备份,这可是一死死全家的节奏。。。。
    7 条回复    2017-06-29 12:38:02 +08:00
    that5
        1
    that5  
       2017-06-29 07:54:32 +08:00 via iPhone
    所以一个好用的网盘收费是有希望的😂
    lekai63
        2
    lekai63  
       2017-06-29 08:53:58 +08:00
    换个 128G or 64G iphone
    回答完毕
    Tink
        3
    Tink  
       2017-06-29 09:14:18 +08:00   ❤️ 1
    太累了,我现在只用 resilio sync
    xiaoz
        4
    xiaoz  
       2017-06-29 09:18:13 +08:00   ❤️ 1
    太累了,我用 seafile
    freestyleyooo
        5
    freestyleyooo  
       2017-06-29 09:31:53 +08:00
    这么累还不如不换苹果,换苹果不就是为了不折腾嘛
    emberzhang
        6
    emberzhang  
       2017-06-29 09:38:33 +08:00 via iPhone
    然后中了勒索病毒全盘完蛋?……
    lfk0000
        7
    lfk0000  
    OP
       2017-06-29 12:38:02 +08:00 via Android
    @lekai63 @freestyleyooo 苹果是二奶,爬山的时候用的
    现在想了一下...爬山的时候都没信号,处理个毛线的在线文档啊.........摔( ๑• ₃ั•๑)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2801 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 10:03 · PVG 18:03 · LAX 03:03 · JFK 06:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.