Resuming a file copy operation
Submitted by Dan Muresan on Thu, 10/16/2008 - 06:46
If you ever need to interrupt (and then resume) a slow cp operation (e.g. from a USB stick or over NFS), you will appreciate cURL’s support for the file:// scheme:
curl -C - -O file:///media/memstick/file.avi
will resume the copy (and display a nice progress report as well).
Here are some alternatives that don't quite work:
- The more famous (and widely-installed) wget doesn't grok file:// URIs
- rsync reads both the source and destination files (in order to compute checksums), so there is no speedup
- Mr. Hartvig's clever recp script uses dd with a block size of 1, which is slow and CPU-intensive
Of course, you can use curl instead of cp to begin with, if you like the progress bar and don't mind the extra keystrokes.
Add new comment