You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows环境下使用rsync升级PostgreSQL副本异常问题求助

Windows环境下使用rsync升级PostgreSQL副本异常问题求助

我现在遇到一个rsync同步PostgreSQL数据目录的棘手问题,按照文档步骤操作但结果完全不对,想请各位帮忙排查下问题所在。

操作背景

我在Windows环境下借助Cygwin的rsync工具,打算同步本地G盘Postgresql_test目录下的两个子目录12pro和13pro(两个目录里都有PostgreSQL的数据目录)到远程服务器。远程服务器的目录结构和本地完全一致,postgresupgrade是我配置的rsync模块,对应远程的G:\Postgresql_test目录。

初始操作及错误

我在CMD里执行了以下命令:

cd G:\Postgresql_test
rsync --archive --delete --hard-links --size-only --no-inc-recursive 12pro \ 13pro postgres@ip_here::postgresupgrade

刚执行就弹出了一堆Cygwin路径警告,还有一堆“文件消失”的错误:

cygwin warning:
MS-DOS style path detected:
Preferred POSIX equivalent is: /cygdrive/g
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
file has vanished: "/cygdrive/g/Postgresql_test//$RECYCLE.BIN"
file has vanished: "/cygdrive/g/Postgresql_test//PostgreSQL" -- 为啥这里会显示G盘根目录下的目录?
file has vanished: "/cygdrive/g/Postgresql_test//Postgresql_test"
file has vanished: "/cygdrive/g/Postgresql_test//Postgresql_test- Copy"
file has vanished: "/cygdrive/g/Postgresql_test//postgres_upgrade"
file has vanished: "/cygdrive/g/Postgresql_test//System Volume Information"
IO error encountered -- skipping file deletion
rsync warning: some files vanished before they could be transferred (code 24) at main.c(1165) [sender=3.1.1]

后续尝试及现象

等了几分钟后查看远程服务器,发现只有12pro目录同步完整了,但13pro只同步了几百MB(实际应该有好几GB)。

后来我把命令里12pro和13pro之间的反斜杠去掉,改成了:

rsync --archive --delete --hard-links --size-only --no-inc-recursive 12pro 13pro postgres@ip_here::postgresupgrade

这次控制台没有再弹出错误,但结果还是一样:旧的12pro同步正常,新的13pro始终没同步完整。

备注:内容来源于stack exchange,提问作者sh4rkyy

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 07:50:07