FreeBSD 11.3 p7 /amd 64 rsync version 3.1.3 protocol version 31 Copyright (C) 1996-2018 by Andrew Tridgell, Wayne Davison, and others. Web site: http://rsync.samba.org/ Capabilities: 64-bit files, 32-bit inums, 64-bit timestamps, 64-bit long ints, socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace, append, ACLs, xattrs, iconv, symtimes, no prealloc, file-flags In an attempt to get a list of updated files, I am using the option: --info=name --out-format=%n This works well some of the time. Unfortunately, there are some mirrors that do not support the "--info=name" option, and exit with a error code of 10. EXAMPLE: rsync: on remote machine: --info=NAME: unknown option rsync error: requested action not supported (code 4) at clientserver.c(839) [sender=3.0.6] rsync: read error: Connection reset by peer (54) rsync error: error in socket IO (code 10) at io.c(785) [Receiver=3.1.3] Since this does not happen on all of the mirror sites, I would like a way to get a list or have rsync display the IP of the site it received an error message from and a way to block the use of that IP in the future. Is that possible? The complete set of options I am sending to rsync is this, if it matters. "--no-motd --quiet --times --compress --update --no-dirs --info=name --out-format=%n" Thanks! -- Gerard -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/rsync/attachments/20200407/3f42189e/attachment.sig>
On Wed, Apr 8, 2020 at 8:15 AM Gerard E. Seibert wrote:> Since this does not happen on all of the mirror sites, I would like a way > to get a list or have rsync display the IP of the site it received an error > message from and a way to block the use of that IP in the future. Is that > possible? >You can get rsync to ouptut the IP it connected to by using this option: --debug=connect2 As for avoiding a bad IP, rsync doesn't choose the IP itself, so there are a couple things you could do instead of hacking on the rsync source code to add some DNS-lookup and IP-exclusion code: The simplest is to put a single IP & domain-name combo into your /etc/hosts file, at which point that will be the only mirror that rsync uses for that domain name. If you instead want it to cycle between multiple IPs, you could use a simple caching DNS setup via dnsmasq. This software has a very simple override method where you specify a "addn-hosts=/file/name" line in its config file and then put multiple /etc/hosts style lines into it (since dnsmasq will add all the "IP DOMAIN" lines into a multi-IP result for that DOMAIN, unlike the normal local resolver which just picks the first IP). You'd just need to be sure to configure your localhost DNS lookups to use dnsmasq, which can be as simple as adding a "nameserver 127.0.0.1" line at the start of your /etc/resolve.conf file in front of your other nameserver line(s) (since dnsmasq skips a leading localhost nameserver line for its forwarded requests while local lookups use the first line in preference to the others). An alternative config option would be to add "alias" directives into the dnsmasq config where you tell it to replace a bad IP with a known-good IP. ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20200422/d391c803/attachment.htm>