Omnigia

October 16, 2008

Resuming a file copy operation

Filed under: linux — Dan Muresan @ 6:46 am

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:

  1. The more famous (and widely-installed) wget doesn’t grok file:// URIs
  2. rsync reads both the source and destination files (in order to compute checksums), so there is no speedup
  3. 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.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

[ Powered by WordPress ]