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

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Hongyi Zhao
Hi all,

See the following commands:

werner@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?

Regards
--
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|

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

Heiko Schlittermann
Hongyi Zhao <[hidden email]> (Mi 15 Apr 2015 13:32:23 CEST):

> Hi all,
>
> See the following commands:
>
> werner@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 ------------ -

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

signature.asc (484 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

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

Hongyi Zhao
On Wed, 15 Apr 2015 14:39:10 +0200, Heiko Schlittermann wrote:

> Because you didn't tell.
>
>     … 2>aaaa
>
> Note the missing space between die file descriptor and the redirection
> operator.

Then, why the following one will work, i.e., use a space between the
redirection operator and the logfile:

… 2> aaaa

Regards
--
.: Hongyi Zhao [ hongyi.zhao AT gmail.com ] Free as in Freedom :.

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Reply | Threaded
Open this post in threaded view
|

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

Heiko Schlittermann
Hongyi Zhao <[hidden email]> (Mi 15 Apr 2015 14:58:21 CEST):

> On Wed, 15 Apr 2015 14:39:10 +0200, Heiko Schlittermann wrote:
>
> > Because you didn't tell.
> >
> >     … 2>aaaa
> >
> > Note the missing space between die file descriptor and the redirection
> > operator.
>
> Then, why the following one will work, i.e., use a space between the
> redirection operator and the logfile:
>
> … 2> aaaa
Because of because :)

Why is FOO=bar without the dollar sign, while in echo "$FOO" I've to use
the dollar sign?

    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 ------------ -

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

signature.asc (484 bytes) Download Attachment