我试过这个命令:
rsync -v --include-from=/path/to/list.lst /home/user /path/to/backup
list.lst包含例如
.gnupg/ .pki/ .gnome2/keyrings/ .mozilla/firefox/*.default/bookmarkbackups/ .mozilla/firefox/*.default/bookmarks.html .mozilla/firefox/*.default/*.db .mozilla/firefox/*.default/*.sqlite
和我得到所有string的错误:
失败:没有这样的文件或目录
当我使用--files-from ,我也会遇到一个错误。 任何人都可以帮我使用通配符?
您可以使用包含filter和--include-from : Complex包含/不包含rsync
或者你可以使用find命令:
cd rsync -v --files-from <(find gnupg/ .pki/ .gnome2/keyrings/ \ .mozilla/firefox/*.default/bookmarkbackups/ \ .mozilla/firefox/*.default/bookmarks.html .mozilla/firefox/*.default/*.db \ .mozilla/firefox/*.default/*.sqlite) \ ~ /path/to/backup
我想你可能需要添加--recursive选项并使用--files-from 。
我认为你的list.lst的文件名必须以+或-开头:
- *.o - foo/ + *.exe + 123/456/*
下面的网页介绍了一种可能的解决scheme。 它看起来像错误行是误导,检查后面的“代码”错误。
http://kenfallon.com/rsync-mkstemp-failed-no-such-file-or-directory-2/
https://access.redhat.com/solutions/60592
我有类似的问题,“(代码23)”,但我仍然不知道为什么或如何解决这个问题。 如果我把这些文件在命令行而不是在--files-from文件中传输(foo * .xml),它将起作用。 我开始认为--files-from不像星号,问号等模式。也许我需要使用--include-from ,问题是,我发现--include-from包括--include-from混淆包括和排除文件。
0 Success 1 Syntax or usage error 2 Protocol incompatibility 3 Errors selecting input/output files, dirs 4 Requested action not supported: an attempt was made to manipulate 64-bit files on a platform that cannot support them; or an option was specified that is supported by the client and not by the server. 5 Error starting client-server protocol 6 Daemon unable to append to log-file 10 Error in socket I/O 11 Error in file I/O 12 Error in rsync protocol data stream 13 Errors with program diagnostics 14 Error in IPC code 20 Received SIGUSR1 or SIGINT 21 Some error returned by waitpid() 22 Error allocating core memory buffers 23 Partial transfer due to error 24 Partial transfer due to vanished source files 25 The --max-delete limit stopped deletions 30 Timeout in data send/receive 35 Timeout waiting for daemon connection
确保/path/to/list.lst中的行在行尾没有空格。 我不知道为什么rsync如此敏感。