I see that when I use rsync with the -v option it prints the changed files list and some useful infos at the end, like the total transfer size.
Is it somewhat possible to cut out the first (long) part and just print the stats? I am using it in a script, and the log shouldn't be so long. Only the stats are useful.
Thank you.
This solution is more a "hack" than the right way to do it because the output is generated but only filtered afterwards. You can use the option --out-format
.
rsync ... --out-format="" ... | grep -v -E "^sending|^created" | tr -s "\n"
The grep
filter should probably be updated with unwanted lines you see in the output. The tr
is here to filter the long sequence of carriage returns.
grep -E
for extended regexesgrep -v
to invert the match. "Selected lines are those not matching any of the specified patterns."tr -s
to squeeze the repeated carriage returns into a single one
Ok, that sorta works. Have to add the tag "deleting" too. Thank you very much.