与
ESC
输入关键词搜索文章

unison的参数说明和命令行使用

全文约 537 字预计阅读 2 分钟
这里不介绍unison的安装,主要是参数说明和命令行使用 /root/bin/unison  /root/test root@192.168.1.2//root/test  -times -owner=true -group=true -fastcheck=true –batch –perms=-1 -silent -logfile=/root/.unison/unison.log  -ignore 'Path cache' -ignore 'Name .svn' -batch -repeat 1 具体可以使用-help参数查看说明: path xxx参数//只同步-path参数指定的子目录以及文件,而非整个目录,-path可以多次出现。 times 保持文件时间属性 force表示会以本地所指定文件夹为标准,将该目录同步到远端。指定force参数就变成了单项同步,类似rsync。对于一个文件在两个同步文件夹中都被修改时,unison是不会去同步的。 ignore = Path表示同步时忽略指定目录 ignorecase [true|false|default] 是否忽略文件名大小写 owner group 保持文件所有者和组属性 fastchek  true表示只比对时间,false表示比对文件内容 logfile 表示日志文件存储位置 silent 在终端中不显示任何信息,除非出现错误 log 记录日志,默认开启 perms 同步文件权限 retry 错误时重试次数 sshargs = -C //使用ssh的压缩传输方式 repeat 间隔检查时间(秒) fastcheck=true表示同步时仅通过文件的创建时间来比较,false则比较两地文件的内容。 servercmd 指定远程计算机unison命令的位置 follow xxx //是否支持对符号连接指向内容的同步 xferbycopying = true不变目录,扫描 时可以忽略 auto 接受缺省的动作,然后等待用户确认是否执行。 batch 全自动模式,无需干预 Unison 同步配置文件,如果使用的别的账号,切换到对应的账号下使用。 文件位置:/root/.unison/default.prf 运行参数:/root/bin/unison default.prf //直接到对应的账户目录下去找配置文件 #Unison配置文件内容 root = /root/test/ root = ssh://root@192.168.1.2//root/test/ path = test1/ path = test2/ servercmd = /root/bin/unison #force = #ignore = batch = true #repeat = 1 #retry = 3 owner = true group = true perms = -1 fastcheck = true rsync = false sshargs = -C xferbycopying = true log = true logfile = /root/.unison/unison.log
unison的参数说明和命令行使用
分享

发表评论

评论 0 条

暂无评论,来说点什么吧。