xfennec / progress Goto Github PK
View Code? Open in Web Editor NEWLinux tool to show progress for cp, mv, dd, ... (formerly known as cv)
License: GNU General Public License v3.0
Linux tool to show progress for cp, mv, dd, ... (formerly known as cv)
License: GNU General Public License v3.0
Had to install libncurses5-dev
when compile cv in Cygwin or MingW, compiler complain missing header:
CYGWIN:
cv.c:37:22: fatal error: linux/fs.h: No such file or directory
MINGW32:
cv.c:32:23: fatal error: sys/ioctl.h: No such file or directory
by googling those issue has no quick fix in header level, can you add support to then by modify the source code? thanks.
The screenshots use a highly customized shell which detracts from what the tool actually does. Perhaps do PS1='$ ' before taking the screenshots?
It would be nice if you would add support for vcp
and vmv
. These are "mods" for GNU mv
and cp
from Advanced Copy package which show progress while commands are being executed..
Currently executing cv -c vcp
or cv -c vmv
works, but it would be nice to have these included as default.
Homepage for Advanced Copy: http://beatex.org/web/advancedcopy.html
Let me know what you think regarding this.
Would you like to add more error handling for return values from functions like the following?
What font are you using for powerline in those screenshots? And what powerline lib? Zsh or Bash?
Thanks. I'm using Menlo and I don't care for it as much.
The make install step fails if there's no directory called ~/bin and /usr/local/bin can't be written to.
Hi,
when you copy / move a lot of small files, cv is too slow to open the fd information. So there are permantly some errors showing in monitor mode.
Just stumbled about it while moving my photo collection to my new ssd, maybe this error is not reproducable with normal hard drives.
Suggested change: A file not found error should be ignored and not printed out in monitor mode. Maybe redirect it to stderr.
Regards,
Simon
I used mv to copy a local 1Gb file to a nas.
mv told me that the progress was 100% after a few seconds while it last a few minutes before completing.
My assumption is that mv is monitoring the read once the file was all read and that the write was actually buffered and syncing. I am not sure it is consistent with the fact that mv did not exit.
I used mv to copy a local 1Gb file to a nas.
mv told me that the progress was 100% after a few seconds while it last a
once the file was all read
I would like to point out that identifiers like "_MAIN_H
" and "_SIZES_H
" do not fit to the expected naming convention of the C language standard.
Would you like to adjust your selection for unique names?
I can help test.
What's the problem?
cat inactive/flushing/streaming/...
cv, as much as it's an amazing short name, doesn't really relate to what the thing does. I wager a bet that most people won't use the command as any other one-syllable commands (cat, cp, mv, cd, ...) so a longer, more descriptive name would be more fitting. The first thought is "progress" but someone might have a better idea. Typing prog^I will be enough to run it at least on my system (which is a very non-special Ubuntu install)
hello xfennec,
I intend to package your program cv for debian.
Can't find your email address hence notify you here :-)
$ make && make install
gcc -g -Wall -D_FILE_OFFSET_BITS=64 -c cv.c
cv.c:32:20: fatal error: curses.h: No such file or directory
#include <curses.h>
^
compilation terminated.
make: *** [cv.o] Error 1
Of course, for
is not a executable but a built-in command so I this is pretty difficult, but is there any possibility? Can you find the information needed with ptrace()
on an sh
or bash
process?
This would be awesome if it was installable by home brew?
Is this something the project has looked at doing
I'm copying some sparse files (VMDKs created by VMware). The apparent size of one of the files is 900GB, while the actual size of the file is 434GB. While copying the file with cp (which properly supports copying sparse files), progress reports the size of the file as the apparent size rather than the actual size.
Is proper support for sparse files on the roadmap at all?
Someone suggested your progress in the /r/bash
discussion about my progress-bar.sh
project.
Just though it might be nice to improve your UI using an interface like mine instead of only numeric value.
PROGRESS_ARGS=' ' progress works, as does PROGRESS_ARGS='-M' progress and PROGRESS_ARGS='-M' progress -M, but then we have:
$ PROGRESS_ARGS='-M' progress -M -M
Segmentation fault (core dumped)
$ PROGRESS_ARGS='-M' progress --ignore-file ~/.xsession-errors
Segmentation fault (core dumped)
It would be nice to have support for the rsync
command.
It would be nice to have support for the 'rm' command.
The description of the project tell's rm is supported but it is not in the list of commands that are monitored by default.
progress -c rm
also didn't work.
There's an option called --monitor-continous
, which is spelled incorrectly.
It should be --monitor-continuous
.
Could the time format for ETC/ETA be changed to make it look more like a time?
The output looks like:
[ 1099] dd /dev/sde 5.7% (26.7 GiB / 465.8 GiB) 13.9 MiB/s eta 8:59:59
which makes me wonder if the ETC is really a countdown for the amount of time remaining.
Could it be in a standard time format instead
Currently trying to package this for the AUR, but the Makefile only installs to ~/bin
//usr/local/bin
, so it's impossible to change that directory to a fakeroot and build the package.
Hello,
I am highly interested in this software, which I would like to package for Debian as soon as I get some time (which, unfortunately, may only happen in some months…). Anyway, I thought about one possible way of using cv which could be useful:
$ cv COMMAND
For instance:
$ cv cp bigfile /tmp
That would be the same kind of usage than commands like nice for instance, and would imply for cv to fork; in the child, to exec() the command specified in its arguments, and in the parent, to monitor continuously its child.
You have a .travis.yml file but it is not being used for your branches and incoming pull requests. If you go to travis-ci.org and login with Github you can enable Travis testing for every commit.
When copying or moving multiple files using e.g. the command cp 1 2 3 target/directory/
, those parameters are visible using ps aux
.
I'm aware it's also possible to find the current working directory of a process using /proc/<pid>/cwd
, so you could use that to determine which files cp / mv has already been operated on, as well as which files it's going to operate on. The command-line arguments are relative to the working directory, but it seems we could easily get that information and find out the full file paths.
With that information, wouldn't it be possible for cv to show the total progress (counting all files to be copied or moved) as well as the current file progress?
I would be willing to work on a pull request for this, but would first want to make sure you think it's doable, whether it's a good idea, etc.
Thanks.
Hi, I want to submit cv to homebrew, but the latest release 0.6 has not included #19. So it doesn't support OSX.
Can we have a new release now for OSX?
see Homebrew/legacy-homebrew#40925
I always just use progress -M. I would like to be able to omit -M. When doing top you always get the "live monitoring" view as well, rather than the "one-shot" display.
gcc -Wall -lncurses -lm cv.o sizes.o hlist.o -o cv anabrodov@tomsk
cv.o: In function nprintf': /home/anabrodov/bin/cv/cv.c:72: undefined reference to
vwprintw'
cv.o: In function nfprintf': /home/anabrodov/bin/cv/cv.c:83: undefined reference to
vwprintw'
cv.o: In function nperror': /home/anabrodov/bin/cv/cv.c:91: undefined reference to
printw'
cv.o: In function monitor_processes': /home/anabrodov/bin/cv/cv.c:465: undefined reference to
stdscr'
/home/anabrodov/bin/cv/cv.c:465: undefined reference to wclear' /home/anabrodov/bin/cv/cv.c:466: undefined reference to
stdscr'
/home/anabrodov/bin/cv/cv.c:466: undefined reference to wrefresh' /home/anabrodov/bin/cv/cv.c:514: undefined reference to
stdscr'
/home/anabrodov/bin/cv/cv.c:514: undefined reference to wclear' /home/anabrodov/bin/cv/cv.c:515: undefined reference to
stdscr'
/home/anabrodov/bin/cv/cv.c:515: undefined reference to wrefresh' cv.o: In function
int_handler':
/home/anabrodov/bin/cv/cv.c:581: undefined reference to endwin' cv.o: In function
main':
/home/anabrodov/bin/cv/cv.c:597: undefined reference to initscr' /home/anabrodov/bin/cv/cv.c:609: undefined reference to
stdscr'
/home/anabrodov/bin/cv/cv.c:609: undefined reference to wrefresh' /home/anabrodov/bin/cv/cv.c:614: undefined reference to
endwin'
hlist.o: In function set_hlist_size': /home/anabrodov/bin/cv/hlist.c:12: undefined reference to
ceil'
collect2: error: ld returned 1 exit status
Some missing dependencies?
Perhaps this is related to issue #15 .
Following command:
dd if=/dev/urandom of=/dev/null bs=1M count=100000
does not yield output in 'progress'. It does detect a running dd command, since the warning "No command currently running" does not appear, but does not show any progress output.
Changing the output file to /tmp/foo fixes that.
Perhaps it is impossible to get accurate progress information in this case, but I'd expect a message telling me that.
Trying the utility now - I'll respond if I end up working on this ticket.
Set up a way to execute commands and monitor them.
e.g.:
progress -C "cp -a /media/cdrom/x /storage/c/"
will fork cp in the background, and monitor it on the stdin. This allows me to run the progress and cp in one tty only.
It is not clear how to add multiple arguments, please add an example which contains multiple long-form and short-form arguments.
It is not mentioned which arguments take precedence (env or command line).
I get this error:
progress.c:48:11: fatal error: 'linux/fs.h' file not found
Is there any way to make it compatible with FreeBSD?
Hi,
Since today I'm running into an issue while trying to install progress on Ubuntu 14.04, here is the output I get, apparently it has something to do with 96a39c2. Are there any new installation steps on top of installing libncurses5-dev ?
Anyway, using release v0.12.1 is still working.
---- Begin output of cd /home/vagrant/progress && make && sudo make install ----
STDOUT: cc -Wall progress.o sizes.o hlist.o -o progress -lm
STDERR: Package ncurses was not found in the pkg-config search path.
Perhaps you should add the directory containing `ncurses.pc'
to the PKG_CONFIG_PATH environment variable
No package 'ncurses' found
progress.o: In function `nprintf':
/home/vagrant/progress/progress.c:96: undefined reference to `vwprintw'
progress.o: In function `nfprintf':
/home/vagrant/progress/progress.c:107: undefined reference to `vwprintw'
progress.o: In function `nperror':
/home/vagrant/progress/progress.c:115: undefined reference to `printw'
progress.o: In function `monitor_processes':
/home/vagrant/progress/progress.c:700: undefined reference to `stdscr'
/home/vagrant/progress/progress.c:700: undefined reference to `wclear'
/home/vagrant/progress/progress.c:701: undefined reference to `stdscr'
/home/vagrant/progress/progress.c:701: undefined reference to `wrefresh'
/home/vagrant/progress/progress.c:767: undefined reference to `stdscr'
/home/vagrant/progress/progress.c:767: undefined reference to `wclear'
/home/vagrant/progress/progress.c:830: undefined reference to `stdscr'
/home/vagrant/progress/progress.c:830: undefined reference to `wrefresh'
progress.o: In function `int_handler':
/home/vagrant/progress/progress.c:840: undefined reference to `endwin'
progress.o: In function `main':
/home/vagrant/progress/progress.c:874: undefined reference to `initscr'
/home/vagrant/progress/progress.c:886: undefined reference to `stdscr'
/home/vagrant/progress/progress.c:886: undefined reference to `wrefresh'
/home/vagrant/progress/progress.c:891: undefined reference to `endwin'
collect2: error: ld returned 1 exit status
make: *** [progress] Error 1
---- End output of cd /home/vagrant/progress && make && sudo make install ----
Thanks
Hi,
Really progress is a nice idea. But I've tried and I don't understand what it does.
For example:
progress -c firefox
[13536] firefox /home/sergio/.local/share/baloo/index
0.0% (0 / 641.3 MiB)
It always shows the same thing. No matter Firefox does, and does not show anything when download a file.
Could you explain what I am missing of this tool?
Thanks in advance
I suggest to reuse a higher level build system than your current small make file so that powerful checks for software features will become easier.
Hello,
I think it could be useful to be able to let cv monitor a running process, or a list of processes, by PID, that is:
$ cv -p PID [PID…]
That would allow to specify exact processes instead of relying on the command names; in addition it would make it possible to use tools such as pgrep to do that selection, for instance:
$ cv -p $(pgrep -f bigfile)
(in this example, pgrep prints the PIDs of processes which have the string “bigfile” in their full commande line, and this list is passed as argument after “cv -p”)
When starting up progress and -w, -W, -m, or -M are set, only wait for 0.1s before displaying the UI, otherwise progress feels sluggish. Further updates should happen according to whatever has been set or default (1 second).
$ PROGRESS_ARGS='--ignore-file ~/.xsession-errors' progress -M
Invalid arguments.
Please make the command the last element of the readout because it varies in width considerably and it's fairly difficult to follow that way. Especially applicable if you have something like mv running and it's going over many files of different file name lengths. The new order should be: speed, progress%, progress numbers, command name. ("progress numbers" means X MiB/Y MiB).
Would be great to have support for du
. Is this possible?
When dd one device to another, size of the target is shown. This is ok, when source size > target size, but this situation is weird.
Common usage is to dd equal devices or smaller to bigger. In last case, the amount of bytes (blocks) to copy is determined by source device size.
But cv uses target device size thus giving wrong estimation.
I guess that a different program design will be needed for your function "int_handler".
Please tag a version of this software, even if it is just 0.1 to start.
When in -m, do not update the whole screen. Have the cursor move around the screen and only rewrite the parts that are necessary to update. This is, for example, how "watch" does this, as well as all the others (top, irssi, ...). Updating the whole screen makes it impossible to copy stuff out of the terminal, which is super annoying.
You can likely do this by using the right lib for terminal display or the right options to it.
Every time I do progress -m I see this stuff:
[8958] cat /home/cheater/.xsession-errors 100.0% (728.2 KiB / 728.2 KiB) 0/s
[8959] cat /home/cheater/.xsession-errors 100.0% (728.2 KiB / 728.2 KiB) 0/s
This is from google chrome. I have no idea why it's doing that but I wouldn't like to see it. Please provide a way for me to stop seeing this. Important: this should not include adding new command line parameters. So either read a config file or figure out that the parent pid of that cat is chrome.
Here's what chrome looks like in pstree:
| | | |-mate-panel-+-chrome-+-2*[cat]
| | | | | |-chrome-+-chrome-+-chrome---29*[{chrome}]
| | | | | | | |-chrome---156*[{chrome}]
| | | | | | | |-13*[chrome---10*[{chrome}]]
| | | | | | | |-chrome---21*[{chrome}]
| | | | | | | |-2*[chrome---13*[{chrome}]]
| | | | | | | |-53*[chrome---9*[{chrome}]]
| | | | | | | |-2*[chrome---8*[{chrome}]]
| | | | | | | |-chrome---{chrome}
| | | | | | | |-2*[chrome---7*[{chrome}]]
| | | | | | | |-3*[chrome---11*[{chrome}]]
| | | | | | | |-chrome---14*[{chrome}]
| | | | | | | |-chrome---19*[{chrome}]
| | | | | | | |-chrome---24*[{chrome}]
| | | | | | | `-chrome---17*[{chrome}]
| | | | | | `-nacl_helper
| | | | | |-chrome-+-chrome
| | | | | | `-3*[{chrome}]
| | | | | `-45*[{chrome}]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.