Bug 11561 - [PATCH] Show progress information when SIGINFO is caught on platforms that have it
Summary: [PATCH] Show progress information when SIGINFO is caught on platforms that ha...
Status: RESOLVED FIXED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.2
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-19 23:30 UTC by Dag-Erling Smørgrav
Modified: 2020-04-05 22:09 UTC (History)
1 user (show)

See Also:


Attachments
Show progress information when SIGINFO is caught (1.68 KB, patch)
2015-10-19 23:30 UTC, Dag-Erling Smørgrav
no flags Details
Show progress information when SIGINFO is caught (1.71 KB, patch)
2015-10-19 23:44 UTC, Dag-Erling Smørgrav
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dag-Erling Smørgrav 2015-10-19 23:30:13 UTC
Created attachment 11508 [details]
Show progress information when SIGINFO is caught

The attached patch causes the receiver to show the current file name and the progress line (same output as --progress) when SIGINFO (traditionally bound to ^T on ttys in BSD derivatives) is caught.  Compare with, for instance, tcpdump, which prints statistics (the same information that it usually prints when you kill it) on SIGINFO.
Comment 1 Dag-Erling Smørgrav 2015-10-19 23:44:34 UTC
Created attachment 11509 [details]
Show progress information when SIGINFO is caught

Updated patch eliminates compiler warning on platforms that lack SIGINFO.
Comment 2 Daniel O'Connor 2019-06-05 12:17:08 UTC
What are the prospects for getting this committed?
It works fine on FreeBSD & OSX applied to the latest Samba release and it's quiiiite handy.
Comment 3 Wayne Davison 2020-04-05 22:09:31 UTC
This is a cool idea, but I hadn't taken the time (before today) to tweak it to make it work just right. As written it only output status on a pull, not a push (and thus not for a local copy which uses the push idiom internally). It also had a bug in the output of the file counts (the to-chk=N/TOTAL values) since we now need to set the file index values even when --progress isn't enabled (since a progress output can happen at any time now). I also made it not output the file name again if rsync is running with -v or -i and a status request comes in (it now outputs just the status line under the existing filename).  I also wanted it to be able to work for Linux, so I decided to enable the instant progress output on SIGVTALRM as well as SIGINFO (since Linux doesn't support SIGINFO).  Finally, I decided to change the type of status that gets output to the total-transfer info that is output when using --info=progress2.  This gives you the total file size processed, percent of finished file sizes vs total file sizes (for known files), and the average speed of all received data since the start of the transfer (this is both because the show_progress() calls are not being made and because I think the total-transfer stats are more useful in this sporadic display).