14

I need to copy lots of files. Usually I use rsync because I pass it the -aP options and I can see (a) how many files are left to process and (b) how much of each individual file is copied.

However rsync also does lots of things with checksums to verify that a file was copied. However I don't really need that now. But normal cp doesn't include the above mentioned count of files left, which is very helpful.

Is there anything like cp that includes progress of how many files left, but isn't as heavy as rsync?

Amandasaurus
  • 30,211
  • 62
  • 184
  • 246

6 Answers6

21

You could run rsync with the -W switch, which will disable the checksums.

Stefan Wolff
  • 266
  • 2
  • 3
6

So is this a suitable alias for your suggestions?

cp_p() {
    rsync -WavP $1 $2
}

-W -do not use delta transfer algorithm
-a archive mode
-v verbose
-P show progress bar and retain partial files

another alternative i found at some places. requires pv (pipeviewer) package though.

cp_pv() {
    pv -per $1 > $2
}

-p show progress
-e show eta
-r show rate
-n show numeric output

/edit I have now tested the above aliases and can confirm they work. There were some typos before

Vijay
  • 227
  • 5
  • 14
  • This seems to only support copying one file into a named file rather than a directory. What if I want to copy multiple files? Or a directory? – einpoklum Apr 12 '13 at 20:17
  • Well these are just aliases, so you can experiment with the actual raw commands inside to see what works for you. I'm sure rsync supports directories and other path designations. You can easily customize the aliases to make it work for your specific situation. Do share if you get it working. IIRC I have used it with directories before without a problem. – Vijay Apr 14 '13 at 15:17
3

you could just slap the -v option on the cp cmd or use scp to the localhost

egorgry
  • 2,871
  • 2
  • 22
  • 21
1

It's overkill with the encryption overhead, but you can use scp locally:

scp <file-from> <file-to>

It will display progress while copying.

warren
  • 17,829
  • 23
  • 82
  • 134
1

gcp is the nice tool. Here you have the PyPI package, but this also can be found in distro package (for example in debian/ubuntu apt-get install gcp do the job).

There is also a nice tutorial article about gcp.

$ gcp -r Solaar/ solaar2

Copying 7.53 MiB 100% |#############################| 134.92 M/s Time: 00:00:00
spinus
  • 214
  • 1
  • 4