synchronization - Unison 移动 root 与 rootalias

标签 synchronization rename alias archive unison

我用我的副本更改了硬盘驱动器的安装点

/media/frisch/DATEN/Dok-Daniel/ISAS

/mnt/DATEN_SSD/ISAS

当我想同步这个的时候,Unison 说

警告:未找到这些根的存档文件,其规范名称为:[...] 如果副本很大,则在此运行时更新检测可能需要一段时间。

我究竟该如何使用 rootalias使用旧存档文件(包含当前同步​​状态的内部 Unison 文件)而 Unison 不必重新读取我的所有文件的选项?

最佳答案

rootalias 的正确语法是

rootalias =//new-hostname//new-path ->//old-hostname//old-path

(通过在命令提示符中键入 hostname 查找本地计算机的主机名。)

所以在我的例子中,两个驱动器都安装在本地计算机上,我必须像这样更改我的命令行:

旧:

unison -root "/media/frisch/DATEN_SSD/ISAS/" -root "/media/frisch/DATEN/Dok-Daniel/ISAS/"

新:

unison -root "/mnt/DATEN_SSD/ISAS" -root "/mnt/DATEN/Dok-Daniel/ISAS" \
-rootalias "//frisch-ThinkPad-P51//mnt/DATEN_SSD/ISAS -> \
//frisch-ThinkPad-P51//media/frisch/DATEN_SSD/ISAS" \
-rootalias "//frisch-ThinkPad-P51//mnt/DATEN/Dok-Daniel/ISAS -> \
//frisch-ThinkPad-P51//media/frisch/DATEN/Dok-Daniel/ISAS"

然后我可以在新位置同步文件,而无需缓慢的重新读取。

但是,请记住 Unison 作者的警告。

Warning: The rootalias option is dangerous and should only be used if you are sure you know what you're doing. In particular, it should only be used if you are positive that either (1) both the original root and the new alias refer to the same set of files, or (2) the files have been relocated so that the original name is now invalid and will never be used again. (If the original root and the alias refer to different sets of files, Unison's update detector could get confused.) After introducing a new rootalias, it is a good idea to run Unison a few times interactively (with the batch flag off, etc.) and carefully check that things look reasonable—in particular, that update detection is working as expected.

关于synchronization - Unison 移动 root 与 rootalias,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53118063/

相关文章:

Java 发生在线程启动之前

android - 同步Android和PC的系统时钟

java - 倒计时和进一步同步

java - 当我们使用 renameTo() 两次失败时,为什么?

.net - WCF 客户端界面中的重命名参数

Oracle:如何确定 "AFTER ALTER"触发器中对象的新名称?

用于运行 cmd.exe 内置函数的 PowerShell 别名语法?

c - 如何防止死锁?

macos - 使别名脚本失败

Git 别名 : append string to commit message