Ubuntu

a progress bar for 'cp' and 'mv'

Reported by Hari Seldon on 2006-10-04
74
This bug affects 12 people
Affects Status Importance Assigned to Milestone
coreutils (Debian)
Won't Fix
Unknown
coreutils (Fedora)
In Progress
Unknown
coreutils (Ubuntu)
Wishlist
Unassigned

Bug Description

Binary package hint: coreutils

Hello.
First sorry for my english, but it is not my native langage.

I'm a shelluser, and in my every day utilisation I copy and move some files, and some of them are big (>500Mo for example). So i was searching for progress bar with indication of the pourcentage and something like 34Mo/400Mo, like wget. On linuxfr.org (http://linuxfr.org/~pascalscl/13847.html) i found a discution about that, and i discover a secret option for 'cp' : the -g (for --gauge). I discover too a bug report about that on the archive of the Bug-coreutils mailing list (http://<email address hidden>/msg00610.html).
But it appear that this patch isn't present in the various release of coreutils on Ubuntu.

I know that isn't a bug, and I know that isn't a vital part of the coreutils. But I'm persuaded that the gauge is an interesant evolution for the tools 'cp' and 'mv'. For all the shelluser around the world i think it will be a good comfort to facilitate their utilisation of the shell.

So my question is : what about a future integration of a progress bar in some tools in the coreutils ?

Thank you for your patience :)

Regards.

Hari Seldon (illovae)

tags 185152 +patch

And progress bars in mv, rm and, most important, dd would also be nice!

Best regards,

Onno

# Automatically generated email from bts, devscripts version 2.8.10
merge 284514 185152

tags 68603 wontfix
tags 185152 wontfix
tags 17025 wontfix
retitle 120650 coreutils: chmod: Please add R, W, S and T options
retitle 210475 coreutils: stty: Please add option to force stty to act immediately, not to wait for output to be empty
retitle 21750 coreutils: install: Please add option to compress files
tags 21750 wontfix
tags 48038 upstream
retitle 55218 coreutils: ls: Please add option to sort by type (i.e., all directories before all files)
tags 56844 wontfix
tags 89335 wontfix
stop

Hello.

I wonder if there is an updated version of that patch which works for the
current version of the coreutils in Debian Sid.

I found a HowTo but it’s for Sarge’s version and won’t get applied successfully.

Regards, Mathias

--
debian/rules

merge 185152 389326

Binary package hint: coreutils

Hello.
First sorry for my english, but it is not my native langage.

I'm a shelluser, and in my every day utilisation I copy and move some files, and some of them are big (>500Mo for example). So i was searching for progress bar with indication of the pourcentage and something like 34Mo/400Mo, like wget. On linuxfr.org (http://linuxfr.org/~pascalscl/13847.html) i found a discution about that, and i discover a secret option for 'cp' : the -g (for --gauge). I discover too a bug report about that on the archive of the Bug-coreutils mailing list (http://<email address hidden>/msg00610.html).
But it appear that this patch isn't present in the various release of coreutils on Ubuntu.

I know that isn't a bug, and I know that isn't a vital part of the coreutils. But I'm persuaded that the gauge is an interesant evolution for the tools 'cp' and 'mv'. For all the shelluser around the world i think it will be a good comfort to facilitate their utilisation of the shell.

So my question is : what about a future integration of a progress bar in some tools in the coreutils ?

Thank you for your patience :)

Regards.

Hari Seldon (illovae)

effraie (effraie) wrote :

i comfirm ;)

Scott Bronson (bronson) wrote :

So long as it isn't on by default (so shell scripts don't get messed up), I'm all for it. I'd love to see this.

Daniel Robitaille (robitaille) wrote :

By the way, this was asked in the past in Debian (for "cp") and rejected.

Changed in coreutils:
importance: Undecided → Wishlist
status: Unconfirmed → Confirmed
effraie (effraie) wrote :

why was it rejected?

Daniel Robitaille (robitaille) wrote :

No reasons were given in the Debian bug report about the rejection.

Laurent Bigonville (bigon) wrote :

I think this should be done upstream...

Changed in coreutils:
status: Unknown → Confirmed

It would be bad if Ubuntu introduces some -g option and then later upstream uses -g for something else. Having different options in coreutils in various distros is not good. This should be done upstream.

Yes it's true, the best will be to integrate the "option -g" in all coreutils for all the distribution of GNU/Linux and derivated. But how can we contact the developers of coreutils ? And can an end-shell-user can be allowed to do this without appear insulting opposite to their labor ?

Hello.

For anyone interested I’ll attach the necessary patch, working at least for
version 5.97-5. I made sure it builds using the acl and selinux patches.

Regards, Mathias

--
debian/rules

Micah Cowan (micahcowan) wrote :

I think such a feature should possibly be enabled via a long-option only. This should drastically decrease the likelihood of conflicting with cp/mv from other OSses. (My 2¢.)

It seems your patch have an error with coreutils 5.97-5.3:

if
colorgcc -std=gnu99 -DHAVE_CONFIG_H -DLIBDIR=\"/usr/lib\" -I. -I. -I.. -I.. -I. -g -DSYSLOG_SUCCESS -DSYSLOG_FAILURE -DSYSLOG_NON_ROOT -O2 -MT
utimecmp.o -MD -MP -MF ".deps/utimecmp.Tpo" -c -o utimecmp.o utimecmp.c; \
        then mv -f ".deps/utimecmp.Tpo" ".deps/utimecmp.Po"; else
rm -f ".deps/utimecmp.Tpo"; exit 1; fi
In file included from utimecmp.c:41:
utimens.h:2: error: conflicting types for 'futimens'
/usr/include/sys/stat.h:370: error: previous declaration of 'futimens' was
here

I realize that this is just a wishlist level item but I wanted to
register my objection to the additional code to implement progress
bars to cp, mv, rm, etc. Those utilities are already too bloated.

Also the functionality of progress bars exists in rsync. If someone
wants a tool with everything including the kitchen sink then using
rsync works well and already exists.

  rsync --progress -av SOURCE DESTINATION

Bob

Hi Victor-Philipp.

Victor-Philipp Busch, 13.07.2007 11:31:
> It seems your patch have an error with coreutils 5.97-5.3:
>
> if
> colorgcc -std=gnu99 -DHAVE_CONFIG_H -DLIBDIR=\"/usr/lib\" -I. -I. -I.. -I.. -I. -g -DSYSLOG_SUCCESS -DSYSLOG_FAILURE -DSYSLOG_NON_ROOT -O2 -MT
> utimecmp.o -MD -MP -MF ".deps/utimecmp.Tpo" -c -o utimecmp.o utimecmp.c; \
> then mv -f ".deps/utimecmp.Tpo" ".deps/utimecmp.Po"; else
> rm -f ".deps/utimecmp.Tpo"; exit 1; fi
> In file included from utimecmp.c:41:
> utimens.h:2: error: conflicting types for 'futimens'
> /usr/include/sys/stat.h:370: error: previous declaration of 'futimens' was
> here

No, that’s a bug in coreutils. However, I don’t know why it doesn’t work for you
where it did for me. See #433394 for a fix. (Might still require backporting
since the patch over there is for version 6.0.)

I updated the patch to work with coreutils 6.0-1 from Experimental. As ususal,
use at your own risk; it works fine here, though.

Regards, Mathias

--
debian/rules

Changed in coreutils:
status: Confirmed → Won't Fix

# Automatically generated email from bts, devscripts version 2.10.11
tags 185152 - patch

C de-Avillez (hggdh2) wrote :

This option(s) have been suggested upstream for quite some time now; last one was at about end of 2007. If something is to be done for a progress bar on cp, rm, mv, etc, it should, indeed, be upstream.

You can contact upstream at <email address hidden>.

Kamil Dudka (kdudka) wrote :

It is suggested to use rsync as cp replacement in such cases - consider this bug: https://bugzilla.redhat.com/show_bug.cgi?id=237553

Changed in coreutils:
status: Unknown → In Progress

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,

Updated patch for coreutils at least version 7.1.

Regards, Mathias

- --
debian/rules
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknG0O0ACgkQYfUFJ3ewsJiBlQCfQejSCG42ptuvrHhKL4vGByXU
6t8AmwS7e/h1XU+mWkXbsjJvfLXrapJa
=pKDe
-----END PGP SIGNATURE-----

hackeron (hackeron) wrote :

I can't find an example that will show the overall progress of recursively copying a directory? - Anyone?

Rsync shows progress per file and an overall filecount, but is there anything that will show overall progress for size?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

Here’s the patch refreshed against the latest coreutils 8.1.

Regards, Mathias

- --
debian/rules
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksL2vYACgkQYfUFJ3ewsJj0wACeLK/CzGP4pu7RXxuEdtib3q3d
epQAn3ruREoL6Zv/jJfrD39JundZHlNR
=5VqH
-----END PGP SIGNATURE-----

hackeron (hackeron) wrote :

Anything? :)

C de-Avillez (hggdh2) wrote :

For the record, the RH bug has been closed WONTFIX, here you have Ondrej's comment:

"Time to close that bugzilla...
Discussed many times on upstream list (see archives),
in bugzillas of other linux distributions (e.g.
https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/64067
http://www.linux-archive.org/archlinux-development/167447-add-g-option-cp-mv.html
)

If you really want to have this behaviour, you could use some shell script
alias to get this. One of such scripts is available at
http://chris-lamb.co.uk/2008/01/24/can-you-get-cp-to-give-a-progress-bar-like-wget/
 . Closing WONTFIX."

I will keep this bug open only because upstream will look at a *generic*, usable-everywhere solution. But -- unless you intend to code it, please do not expect any coreutils-implemented solution anytime soon (if at all). There are other ways of getting it (see Ondrej's comment above.

Changed in coreutils (Ubuntu):
status: Confirmed → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.