I'm looking for a tool that takes two arguments:
- a command to execute, and
- a target value
The tool should then run the command continuously, look for a number in the output of the command, and estimate the time it will take until the number reaches the target value.
Example: Suppose I want to track of an
scp file transfer. I would then check the size on the sending end, and continuously run
du -b on the receiving end. It would look something like this:
$ du -bs source_directory 5798324564 $ *sometool* 5798324564 "ssh someserver du -bs destination_directory" 2019-01-28 21:03:10 - 23.2% - ETA 22:15:10 (1h 12m) 2019-01-28 21:03:40 - 26.3% - ETA 22:14:57 (1h 11m) 2019-01-28 21:04:10 - 29.3% - ETA 22:14:49 (1h 10m) ... <continous output until 100% is reached> ... 2019-01-28 22:15:05 - 100% - done. $
It would be similar to
watch in the sense that it executes a given command repeatedly, but the difference being that instead of printing the output of the command, it should look for a progress value in the output, and compute an ETA.