ETA(1) | eta manual | ETA(1) |
eta - calculate eta of a running process by repeatedly inspecting its progress
eta [OPTIONS] TARGET PROGRESS_COMMAND
eta prints the progress and estimated time to completion based on the given PROGRESS_COMMAND and TARGET value.
PROGRESS_COMMAND should be a command that prints the current progress of some running process. If, for example, the running process is a file copy, a suitable progress command would be du -b some.file
TARGET should be the target value (value representing 100%) for the progress command. For a file copy the target value should be the size of the source file.
If you have for example the following process running:
you could monitor its progress and eta using
It's similar to watch(1) in the sense that it executes the given command repeatedly, but instead of displaying the output of the command, it parses the output and displays the progress and eta.
See NOTES for further details.
Options adjust the behavior and output of eta.
…you use…
…to avoid having the progress start at 50%.
If you use initial the first value returned by the progress command will be used as start value. This could be useful if you don't know the original start value, or if you're only interested in the progress of the remaining process.
The default starting value is 0.
Since the starting value will rarely be 0 when using --down the default for --start is changed to initial.
(May not be used in conjunction with --interval.)
If you're copying a directory to a remote host using something like
you can monitor the progress using
If you're processing lots of files using something like
(Resize all jpg images and store the smaller versions in output-dir.) You can use
Note that the number of files may reach the target value before the last file is fully processed.
If you're processing files and removing them as they get processed…
…you can monitor the progress using:
You can use --cont and cat -n to continuously monitor progress based on number of lines printed:
If your running process logs the progress to a file, you could do something like
If you have a process that prints its progress on stdout:
you can use --cont and the command itself as argument to eta:
or, if you're a UUOC fan:
When parsing the TARGET value and --start argument, eta will look for the first digit and start parsing from there. The given values may have a suffix indicating a metric or binary magnitude. Supported suffixes are k, m, g, t, ki, mi, gi and ti (representing 10^3, 10^6, 10^9, 10^12, 2^10, 2^20, 2^30 and 2^40 resp.)
All arguments following the TARGET value will be joined and used as the PROGRESS_COMMAND. That is, there's no need for double quotes here:
If stdout is a file or pipe, eta will print a new line between each progress output, instead of a carriage return. If you want the new line behavior in the terminal, simply pipe the output through cat(1).
eta will only look for the progress value in the first 1000 characters of the first line of output written by the progress command (unless --cont is provided).
Written by Andreas Lundblad (andreas.lundblad@gmail.com).
Report bugs in the issue tracker at github: <https://github.com/aioobe/eta/issues>
09 February 2019 | GNU |