How to capture the stderr of rsync and redirect it into a file?

Heiko Schlittermann hs at schlittermann.de
Wed Apr 15 06:39:10 MDT 2015


Hongyi Zhao <hongyi.zhao at gmail.com> (Mi 15 Apr 2015 13:32:23 CEST):
> Hi all,
> 
> See the following commands:
> 
> werner at debian:~$ rsync -c ftp.cn.debian.org::debian/ 2 >aaa
> rsync: The server is configured to refuse --checksum (-c)
> rsync error: requested action not supported (code 4) at clientserver.c
> (849) [sender=3.0.9]
> rsync: read error: Connection reset by peer (104)
> rsync error: error in socket IO (code 10) at io.c(785) [Receiver=3.1.2dev]
> 
> Why rsync cann't let me redirect the stderr of it into a file, say, aaa, 
> for this case?

Because you didn't tell.

    … 2>aaaa

Note the missing space between die file descriptor and the redirection
operator.

    Best regards from Dresden/Germany
    Viele Grüße aus Dresden
    Heiko Schlittermann
-- 
 SCHLITTERMANN.de ---------------------------- internet & unix support -
 Heiko Schlittermann, Dipl.-Ing. (TU) - {fon,fax}: +49.351.802998{1,3} -
 gnupg encrypted messages are welcome --------------- key ID: F69376CE -
 ! key id 7CBF764A and 972EAC9F are revoked since 2015-01 ------------ -
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/rsync/attachments/20150415/378f8109/attachment.pgp>


More information about the rsync mailing list