1500字范文,内容丰富有趣,写作好帮手!
1500字范文 > centos配置ocaml及unison进行双向文件同步搭建

centos配置ocaml及unison进行双向文件同步搭建

时间:2022-08-28 13:18:17

相关推荐

centos配置ocaml及unison进行双向文件同步搭建

前言

网站如何从一个服务器上传到另一个服务器总归是一个问题,有幸接触到这个问题。这里就推荐用ocaml及unison吧。

ocaml

ocaml的配置

我用的是centos7,然而,这个似乎是fedora的分支,所以直接用yum install ocaml安装了。

配置unison

这里重点说一说unison,你可以直接用yum install unison,可以成功的。。然而,当你执行同步脚本时候【同步脚本稍后给出来,免得没办法测试】

可能会出现这个问题:

两台机器的unison版本不一致。。我们的服务器版本是2.4.8,而yum install的比较旧,所以只能手动编译了。

首先请找到适合你自己版本的unison。地址如下:

unison地址

稳定版本地址:

这里写链接内容

而我需要的刚好就是稳定版本的,所以直接用这个来安装了:

http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.4.tar.gz

wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.4.tar.gztar -zxvf unison-2.48.4.tar.gzcd unison-2.48.4make UISTYLE=textmake install

大家按照下面来做吧

Install unison1 RequirementsTo install unison you will need the following:a installed and supported operating system (e.g. CentOS 7.x)root-accessaccess to http://www.seas.upenn.edua fast internet connection2 Preliminary notemost of this is taken from/community/questions/install-unison-in-centos-7you may consult the official homepagehttp://www.cis.upenn.edu/~bcpierce/unison3 InstallAs of -01-12 unison isn't listed in any CentOS-7 repository we build it from sourceyum install ocaml ocaml-camlp4-devel ctags ctags-etagscd ~wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.3.tar.gztar xvfz unison-2.48.3.tar.gzcd unison-2.48.3makesudo cp -v unison /usr/bincd ~rm -fr unison*4 UsageBasic usage:unison /mnt/dat /media/ext_HDDif there is some Microsoft-Filesystem involved you maybe won't sync the file-permissionsunison /mnt/dat /media/ext_HDD -perms 0

总结

//--先安装这些yum install ocaml ocaml-camlp4-devel ctags ctags-etags然后wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.4.tar.gztar -zxvf unison-2.48.4.tar.gzcd unison-2.48.4``接着:make## 附带-同步脚本 ##

!/bin/bash 同步前端nodejs - 测试库上面

src=”本机的项目源码地址”

target=”远程目标目录”

ips=(服务器ip地址)

for ip in ips[∗]dounison“ i p s [ ∗ ] d o u n i s o n “ {src}" "ssh://root@ ip:服务器开发的端口号/ i p : 服 务 器 开 发 的 端 口 号 / {target}” \

-force=”${src}” \

-ignore=”Path logs” \

-ignore=”Path statsvn” \

-ignore=”Path node_modules” \

-ignore=”Path uploads” \

-ignore=”Name ServerConf.js” \

-ignore=”Name .svn” \

-ignore=”Name FUpload.swf” \

-ignore=”Name app.js” \

-batch=true \

-owner=false \

-group=false \

-perms=-1 \

-fastcheck=false \

-rsync=false \

-sshargs=-C \

-xferbycopying=true \

-log=true \

-logfile=”/var/log/unison/你的日志文件名字”

done

“`

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。