unison

来自百合仙子's Wiki
跳转到导航 跳转到搜索

unison是一个文件双向同步工具。除了基于命令行的界面外,也有基于GTK的图形界面。

用法

注意:在两台机器上同步时,双方必须使用相同的版本。

unison path1 path2
unison path ssh://user@server//absolute/path
unison path ssh://user@server/relative/to/home/path
unison profile_name
unison profile_name -testserver
#交互运行,每步均提示是否执行
unison profile_name
#不冲突时不提示
unison profile_name -batch

配置文件

配置文件位于 ~/.unison 下,以 .prf 结尾

示例配置

root = /home/lilydjwg/
root = ssh://lily@arch//home/lily/
 
diff = colordiff

path = .zsh
path = .zshrc
path = .vim
path = .gtkrc-2.0
path = .unison/default.prf

ignore = Name *.local
ignore = Name .git

include default

细节

  • 不会顾及硬链接
  • 重命名被识别为单独的添加和删除操作(和rsync一样)

参见

外部链接