I have a log file from rsync command with progress on. When running this progress updates the display information on the same line. When I capture the output from this command I get a file that displays normally with cat
on a terminal (all the backspaces and re-edits are replayed) but I want to be able to use grep
on the file and process it so I see all the backspace edit commands. How can I process the file to remove all the progress updates and just get a file that has the final edits?
Unix – How to display rsync progress from a log file without the carriage returns
loggingrsyncshellunix
Related Question
- R – How to capture rsync progress messages in Perl
- Unix – How to reverse the order of lines in a file
- Bash – How to count all the lines of code in a directory recursively
- Bash – How to reload .bash_profile from the command line
- Linux – How to copy the output of a command directly into the clipboard
- How to delete from a text file, all lines that contain a specific string
- Linux – How to exclude directories from grep -R
Best Solution
If you want to see what your captured file looks like without the progress lines overwriting the previous ones:
which might yield something like this:
If you want to see just the final step of the progress message and eliminate the previous ones:
Which might look like this:
You can run
rsync
with the--log-file=name
option to capture log information in a file. Replace "name" with the name that you want. You can control the information that gets logged using thelog-file-format
option (see the log format section inman rsyncd.conf
for details).On my system the default
rsync
log file looks like this: