progress & redirects

Tim Conway conway at us.ibm.com
Thu May 6 17:49:15 GMT 2004


How about not using --progress when it's running from cron? ... unless 
you're tailing  the logfile, which should also work fine as-is.
If you need to process the logs otherwise later, feed it to "sed 
's/^H.*^H///'" to dump the display crap... or is it "^M" instead of "^H"? 
Those aren't literals.  Produce them by doing a control-V followed by 
control-H or control-M as needed.

Tim Conway
Unix System Administration
Contractor - IBM Global Services
desk:3032734776
conway at us.ibm.com


Hi. I use rsync to suck down a large amount of data every night using a 
cron job that logs to a file. If you run rsync --progress and redirect to 
a log file you end up with the progress for each file piled up onto a 
single line. \r is generally ignored by editors and viewers. That leads to 
my question...

Would it be possible to have rsync output log-friendly progress if output 
is redirected?

For an example of how this can work, check out wget. When run in a shell, 
it outputs a beautiful, dynamic progress bar. When output is redirected it 
outputs periods instead.



More information about the rsync mailing list