Bug? backup_dir sometimes reported on STDOUT, sometimes not.

Axel Essbaum axel at essbaum.com
Fri Jul 3 20:46:13 GMT 2009

Running rsync 3.0.6 on OS X 10.5.7 (on a MacBook Pro) and using the -b  
flag (and -v --verbose), the "backup_dir" is reported in the output,  
but sometimes on STDOUT and sometimes somewhere else.  Note that the  
rsync daemon running on the "server" is 2.6.9 (on another MacBook Pro,  
OS X 10.5.7)

For example, in bash, this happens:

axe-MBP:bin work$ /usr/local/bin/rsync -aub --dry-run -v --verbose -- 
exclude '*~' --backup-dir=/Users/work/Desktop/Heart_and_Soul/backup/ joe at Joe-MBP.local 
:/Users/joe/Desktop/Heart_and_Soul/ /Users/work/Desktop/ 
Heart_and_Soul/ > /dev/null
axe-MBP:bin work$

(all output goes to STDOUT and is redirected to /dev/null)

But by swapping the input and output directories, this happens:

axe-MBP:bin work$ /usr/local/bin/rsync -aub --dry-run -v --verbose -- 
exclude '*~' --backup-dir=/Users/work/Desktop/Heart_and_Soul/backup/ / 
Users/work/Desktop/Heart_and_Soul/ joe at Joe-MBP.local:/Users/joe/ 
Desktop/Heart_and_Soul/ > /dev/null
backup_dir is /Users/work/Desktop/Heart_and_Soul/backup/
axe-MBP:bin work$

In the second case the "backup_dir" report in the output is apparently  
not on STDOUT.

I'm trying to parse/postprocess rsync's STDOUT but let STDERR come  
through untouched, and I notice that half the time I get this spurious  
backup_dir line that's not redirected with the rest of the STDOUT.

- Axel

Axel Essbaum
axel at essbaum.com

More information about the rsync mailing list