![rsync:[发送者]内存不足:my_alloc 调用者(文件=lib/pool_alloc.c,行=143)](https://linux22.com/image/219023/rsync%EF%BC%9A%5B%E5%8F%91%E9%80%81%E8%80%85%5D%E5%86%85%E5%AD%98%E4%B8%8D%E8%B6%B3%EF%BC%9Amy_alloc%20%E8%B0%83%E7%94%A8%E8%80%85%EF%BC%88%E6%96%87%E4%BB%B6%3Dlib%2Fpool_alloc.c%EF%BC%8C%E8%A1%8C%3D143%EF%BC%89.png)
我正在尝试 rsync 一个目录,其中包含一个包含大量文件的子目录。所以当我得到以下信息时,我并不完全感到惊讶:
[sender] out of memory: my_alloc caller (file=lib/pool_alloc.c, line=143)
服务器端内存不足。
有没有一种方法可以告诉我rsync
在内存中保留更少的文件名 - 也许通过使用临时文件作为文件名?
root@remote-end:~# rsync --version
rsync version 3.2.3 protocol version 31
答案1
不是答案,而是一个蹩脚的解决方法:
# Copy the dir structure without files
ssh remote 'cd srcdir; find . -type d' | parallel mkdir -p
find . -type d |
# Sort so the deep dirs come first
perl -e 'print sort { $b=~s:/:/:g <=> $a=~s:/:/:g; } <>;' |
parallel rsync -a remote:srcdir/{} {}
它最终仍然会失败,但希望只有在所有子目录都已同步之后。