rsync logging and permission problems

Dave Dykstra dwd at
Fri Oct 19 23:44:54 EST 2001

On Wed, Oct 17, 2001 at 08:36:22PM -0400, Faheem Mitha wrote:
> Dear rsync people,
> I have just started using rsync for backups. I have had a couple of
> issues. Note I'm trying to use rsync as user using ssh between two
> machines both running Debian GNU/Linux potato (2.2r3). The local machine
> is currently running 2.4.6-1 and the remote 2.3.2-1.2.
> 1) When I run rsync with the vv option, stuff scrolls of my screen faster
> than I can read it. I was wondering if there is a logging option I could
> use. I didn't see it in the documentation. I can use something like "rsync
> -avvz -e ssh localdir/ remotemachine:remotedir/ 2>&1 | less" to look at
> the output, piping both standard output and standard error to less.
> However, I'm puzzled why lines like "Mail/190 is uptodate" are sent to
> standard error. Surely they should be sent to standard output?

Hmm, I can't reproduce that.  When I use vv and >/dev/null, nothing prints.
I'm using the latest version from CVS, but cvsweb tells me the same logic
has been in there at least 3 years:

from log.c:

	if (code == FERROR) {
		log_got_error = 1;
		f = stderr;

	if (code == FINFO) {
		if (am_server) 
			f = stderr;
			f = stdout;

from rsync.c:

	if (verbose > 1 ...
	    rprintf(FINFO,"%s is uptodate\n",fname);

The variable am_server is set on the remote side, but in that case usually
code higher up in log.c will already have sent the message out another way
before it gets to the above code, so the message will get printed on the
client side (the side that initiated the rsync command).

> 2) I am trying to copy the file /var/spool/mail/faheem on the local
> machine to /var/spool/mail/faheem on the remote machine. The problem is
> that only the file on the remote machine (but not the directory) is owned
> by me. rsync first tries to write some other file to /var/spool/mail but
> can't. I then used --temp-dir=/tmp and rsync stopped complaining about not
> being able to write to /var/spool/mail.  However, it still does not seem
> able to write the file correctly to the remote machine (I get error
> messages like :rename /tmp/.faheem.Tb4wnj -> /var/spool/mail/faheem :
> Permission denied"). I don't understand why this is happening, though.

Rsync always replaces files and doesn't just overwrite them.  That's because
it always has to build the new file in a temporary location, and after that
it makes the most sense to just move the temporary file into place.

> Can anyone make suggestions about what to do? I would prefer not to run
> rsync as root on the remote machine. In any case, I tried to do so and
> could not, perhaps because Debian does not allow remote logins as root by
> default.

Sorry, rsync always need write permission to the directory.

> Please cc any reply to me; I'm not on the mailing list. Thanks in advance.
>                                   Sincerely, Faheem Mitha.

- Dave Dykstra

More information about the rsync mailing list