从Linux客户端备份文件到Windows Server


1

我正试图将我的文件从我的Linux盒子备份到我的Windows Server 2008作为推送,当我从Linux盒子中删除它们时,它们仍然在我的Windows Server上。我发现很多相似的来源,但大多数结果都是从Windows到Linux。我设法找到稍微类似的案例,如使用rsync和cygwin将文件从Linux服务器同步到Windows笔记本电脑,以及从Windows PC到远程Linux服务器的rsync,最相似的是从Linux到Windows Server的备份,但是通过从Windows Server拉取。

最初,我使用了Unison,因为我认为拥有双向功能会派上用场,我只需设置一些配置就可以实现单向。不幸的是,我找不到正确的配置,只能使用命令进行同步unison "profile" -ui text -auto -silent。当我删除Linux机器上的文件时,服务器中的文件也被删除了,这当然不是我想要的。当我试图为Unison找到任何选项时,我只发现了-force这个没有帮助的选项,因为我想要的是对服务器的增量更新。

我发现我可以通过使用rsync和-a选项(存档)实现这一点,即使我从Linux框中删除它们也会继续添加文件。

我在我的Windows Server上安装了Cygwin,配置了一个SSH守护进程,但我似乎无法让它工作。我还已将Windows防火墙配置为打开端口22(入站和出站)。我在Linux机器箱中使用了以下命令:

rsync -avrzn /folder/to/be/backed/up/ username@192.168.254.40:/cygdrive/c/place/to/store/backed/up/files

(a - archive,v - verbose,r - recurse into subdirectories,z - compress,n - dryrun)

但它不会起作用。谁能帮我吗?我不介意使用Unison或rsync,只要它能达到我想要的效果。

Answers:


0

我能够使用nodeletion选项以unison方式完成它。在.prf文件中,包含nodeletion=/root/to/ignore/deletions

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.