Resuming a Copy in Linux -- like cp --resume

When you want to copy a large file and close before the end the copy is interrupted. There are some ways to work around this.
When you want to copy a large file and close before the end the copy is interrupted. There are two ways to work around this. One nice way is curl. Go into the target directory and enter: curl -C - -O file:///
e.g.
cd /data && curl -C - -O file:///home/user/somefile.bin

and it will resume where you left of. This works great e.g. with sshfs.

Another way is rsync. Now most people assume rsync *always* checks the whole file, but that's not true...
rsync --size-only --append works in the same way. Only in older version this might not have been possible with rsync.

Last and least there's a quick and dirty bash script using dd called recp.

Still, of course, it's crazy the normal command line cp has no --resume option. Anybody want to write a patch?

If you like this post, you can share it, check out the related posts section below and subscribe to one of the RSS feeds so you don't miss the next one.

1 comment:

  1. If you have an older rsync that doesn't support the --append option, this command will also work:

    rsync --size-only --partial -P src dst

    Also, rsync is MUCH faster than curl at determining where to resume and append the missing data

    ReplyDelete

I appreciate comments. Feel free to write anything you wish. Selected comments and questions will be published.