seems the behavior of rsync has changed when dealing with output and using both -v and -q at the same time ... for example: $ mkdir test1 $ touch test1/foo $ rsync-2.6.0 -avq test1 test2 $ rm -r test2 $ rsync-2.6.8 -avq test1 test2 test1/ test1/fo $ rm -r test2 $ rsync-cvs -avq test1 test2 building file list ... test1/ test1/fo $ rm -r test2 the new output in 2.6.8 comes from the calls to maybe_log_item() and log_item() in send_files() ... one way to fix this would be to update the code around that to check the 'quiet' variable: +++ sender.c @@ extern int verbose; +extern int quiet; @@ send_files() if (!(iflags & ITEM_TRANSFER)) { + if (!quiet) maybe_log_item(file,?iflags,?itemizing,?xname); @@ send_files() if (!do_xfers) { /* log the transfer */ - if (!am_server && log_format) + if (!am_server && log_format && !quiet) log_item(file, &stats, iflags, NULL); another way might be to update log.c and check the quiet status in there ... not quite sure how to go about this one though ... yet another way might be to just tell people to not use -v and -q together: +++ options.c @@ case 'v': + if (quiet) { + snprintf(err_buff, sizeof(err_buf), + "dont use -v and -q\n"); + return 0; + } verbose++; @@ case 'q': + if (verbose) { + snprintf(err_buff, sizeof(err_buf), + "dont use -v and -q\n"); + return 0; + } if (frommain) side note ... the cvs version of rsync is even a little more quirky ... it outputs 'building file list ...' if -v regardless of -q, but only outputs the 'done' if -v and not -q ... -mike
On Sat, May 13, 2006 at 04:27:02PM -0400, Mike Frysinger wrote:> seems the behavior of rsync has changed when dealing with output and using > both -v and -q at the same timeThis comes about because of the new rprintf() enums that the newer code is using, especially the latest CVS version, which has expanded the use of FCLIENT. I think that the best solution is to tweak the code a little so that quiet just allows FERROR messages through, but make the check late enough that the more complex codes (such as FSOCKERR and FLOG) have already been sorted out. Attached is a patch for the CVS version (which should also work on earlier versions). Thanks for pointing this out! ..wayne.. -------------- next part -------------- --- log.c 9 May 2006 18:31:10 -0000 1.150 +++ log.c 14 May 2006 00:21:40 -0000 @@ -224,9 +224,6 @@ void rwrite(enum logcode code, char *buf if (len < 0) exit_cleanup(RERR_MESSAGEIO); - if (quiet && code == FINFO) - return; - if (am_server && msg_fd_out >= 0) { /* Pass the message to our sibling. */ send_msg((enum msgcode)code, buf, len); @@ -258,6 +255,9 @@ void rwrite(enum logcode code, char *buf } else if (code == FLOG) return; + if (quiet && code != FERROR) + return; + if (am_server) { /* Pass the message to the non-server side. */ if (send_msg((enum msgcode)code, buf, len))
On Saturday 13 May 2006 20:26, Wayne Davison wrote:> On Sat, May 13, 2006 at 04:27:02PM -0400, Mike Frysinger wrote: > > seems the behavior of rsync has changed when dealing with output and > > using both -v and -q at the same time > > This comes about because of the new rprintf() enums that the newer code > is using, especially the latest CVS version, which has expanded the use > of FCLIENT. > > I think that the best solution is to tweak the code a little so that > quiet just allows FERROR messages through, but make the check late > enough that the more complex codes (such as FSOCKERR and FLOG) have > already been sorted out. Attached is a patch for the CVS version > (which should also work on earlier versions).thanks, seems to work nicely now in both cvs and 2.6.8 -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: not available Url : http://lists.samba.org/archive/rsync/attachments/20060514/d2cd3619/attachment.bin
Seemingly Similar Threads
- Rsync 2.6.9 Develops Conflict Between --stats, I think --delete-after and Local Filesystem Replication
- [PATCH] Add option --log-after to log after moving file into place
- [RFC] add support for fallocate()
- Problem with exact moment of issuing transfer log entry for a [recv] action
- [Bug 11683] New: hang on select when send many files