请问windows下同步本机和远程主机的文件夹的思路

wrtqwtwetqwet 2010-08-18 10:01:30
我现在要做的是,两台服务器,A和B,要同步这两台机子上的一些文件目录,请问有哪些思路呢?目前我正在尝试unison这个软件,如果你有好的思路或者关于unison软件的中文资料,请给我讲一下哈,谢谢你了~~
...全文
633 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
ccbccb 2010-08-26
  • 打赏
  • 举报
回复
楼主的要求说得还不够详细。

推荐试试Free File Sync,免费开源的,其中文语言文件是由本人(CyberCowBoy:)翻译的,呵呵。如果是用这个,不用什么复杂的连接,简单的局域网共享就行。
wrtqwtwetqwet 2010-08-18
  • 打赏
  • 举报
回复
非常感谢,我还想请问一下
是不是所有同步都要涉及到各种不同的连接呀,譬如socket,SSH,
openSSH现在能兼容window server 2003了吗?兼容的版本号是多少呢?
我现在想在两台windows机子上建立ssh连接,有什么好的软件或思路么? 谢谢~~
dogfish001 2010-08-18
  • 打赏
  • 举报
回复
http://www.unixaid.info/index.php/unixtecspt/35-authentication/317-windows-active-directory

Unison软件包可以在两台主机之间同步文件

unison软件的中文资料1

unison软件的中文资料2



由于Rsync不支持通过FTP协议同步数据,Google后总结了以下几种解决这个问题的方法,暂时还未动手验证过。简单看了下,理论上是可行的。
  一、先说比较简单的方法,就是用同步工具实现。

  A、 Unison

  Unison是windows和unix平台下都可以使用的文件同步工具,它能使两个文件夹(本地或网络上的)保持内容的一致。Unison有文字界面和图形界面,这里只介绍如何在文字界面下使用. unison拥有其它一些同步工具或文件系统的相同特性,但也有自己的特点:

  跨平台使用;

  对内核和用户权限没有特别要求;

  unison是双向的,它能自动处理两份拷贝中更新没有冲突的部分,有冲突的部分将会显示出来让用户选择更新策略;

  只要是能连通的两台主机,就可以运行unison,可以直接使用socket连接或安全的ssh连接方式,对带宽的要求不高,使用类似rsync的压缩传输协议。

  更详细介绍可见这里:linux 文件同步工具Unison的使用

  B、FTPSync

  FTPSync.pl is synchronizes a local directory tree and a remote FTP directory tree. It was initially written to automize web publishing, but other purposes might be fulfilled also. To DOWNLOAD FTPSync.pl, click on Summary/Web Site above.

  更详细介绍可见这里:FTPSync HomePage

            http://sourceforge.net/projects/ftpsync/

  C、csync (基于SMB或SFTP协议)

  csync with enhanced SFTP support is ready for download! csync is a bidirectional file synchronizer for Linux and allows to keep two copies of files and directories in sync. It uses widely adopted protocols like smb or sftp so that there is no need for a server component of csync. It is a user-level program which means there is no need to be a superuser. With pam_csync it is possible to provide roaming home directories in Linux and Active Directory environments.

  更详细介绍可见这里:csync HomePage

  二、Rsync+SSH

  下面这只是个例子:

rsync --delete --times --recursive --perms --owner --group --verbose --progress --stats -e ssh root@192.168.0.100:/folder1/ /folder2/
  
  更详细介绍可见这里:Using Rsync and SSH

  三、通过lftp的mirror模式(ncftp也有mirror模式)

  从FTP服务器上备份到本地

  A、命令行方式  

lftp -c "set ftp:list-options -a;
open ftp://user:password@your.ftp.com;
lcd ./web;
cd /web/public_html;
mirror --delete --use-cache --verbose --allow-chown
--allow-suid --no-umask --parallel=2 --exclude-glob .svn"
  
  B、脚本方式  

#!/bin/bash
HOST="your.ftp.host.dom"
USER="username"
PASS="password"
LCD="/path/of/your/local/dir"
RCD="/path/of/your/remote/dir"
lftp -c "set ftp:list-options -a;
open ftp://$USERPASS@$HOST;
lcd $LCD;
cd $RCD;
mirror --delete \
--verbose \
--exclude-glob a-dir-to-exclude/ \
--exclude-glob a-file-to-exclude \
--exclude-glob a-file-group-to-exclude* \
--exclude-glob other-files-to-esclude"
  
  从本地恢复到FTP服务器上

  A、命令行方式  

lftp -c "set ftp:list-options -a;
open ftp://user:password@your.ftp.com;
lcd ./web;
cd /web/public_html;
mirror --reverse --delete --use-cache --verbose --allow-chown
--allow-suid --no-umask --parallel=2 --exclude-glob .svn"
  
  B、脚本方式  

#!/bin/bash
HOST="your.ftp.host.dom"
USER="username"
PASS="password"
LCD="/path/of/your/local/dir"
RCD="/path/of/your/remote/dir"
lftp -c "set ftp:list-options -a;
open ftp://$USERPASS@$HOST;
lcd $LCD;
cd $RCD;
mirror --reverse \
--delete \
--verbose \
--exclude-glob a-dir-to-exclude/ \
--exclude-glob a-file-to-exclude \
--exclude-glob a-file-group-to-exclude* \
--exclude-glob other-files-to-esclude"
  
  两种方式间主要的差别就是在--reverse选项上,有这个选项就是put files,反之则是get files。

  更详细介绍可见这里:lftp的使用

            用lftp备份文件

            lftp命令详解
wrtqwtwetqwet 2010-08-18
  • 打赏
  • 举报
回复
能在windows下面用吗?我的邮箱是friendship_chenwei@126.com,谢谢
另外,我问一下,是不是所有同步都要涉及到各种不同的连接呀,譬如socket,SSH,
openSSH现在能兼容window server 2003了吗?兼容的版本号是多少呢?谢谢
  • 打赏
  • 举报
回复
我这边有一个CENOTOS 5.2下面配置unison的配置文档,如果LZ需要的话可以留邮件
wrtqwtwetqwet 2010-08-18
  • 打赏
  • 举报
回复
谢谢,我去查下相关的资料,还有其他高手知道其他不同的话,还请不吝赐教啊~~
billpu 2010-08-18
  • 打赏
  • 举报
回复
Allway Sync 开源的免费的 用下来不错 用的人也蛮多的
就是just4 2010-08-18
  • 打赏
  • 举报
回复
Windows下:ntbackup.exe、数据备份专家 Second copy。。。
wrtqwtwetqwet 2010-08-18
  • 打赏
  • 举报
回复
谢谢各位了,我现在想在两台windows机子上建立ssh连接,有什么好的软件或思路么? 谢谢~~
立华合信 2010-08-18
  • 打赏
  • 举报
回复
要么就百度下 这样的软件很多
drifter250771 2010-08-18
  • 打赏
  • 举报
回复
第三方软件也很多的,关于同步备份

6,849

社区成员

发帖
与我相关
我的任务
社区描述
Windows 2016/2012/2008/2003/2000/NT
社区管理员
  • Windows Server社区
  • qishine
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧