26

I recently had to copy about 20 GB of data split between about 20 files from my laptop to an external hard drive. Since this operation takes quite a while (at ~560kb/s), I was wondering if there was any way to pause the transfer and resume it later (in case, I need to interrupt the transfer). As a side question, is there any performance difference between copying from the terminal vs copying from Nautilus?

4 Answers 4

28

I would recommened using rsync.

Example:

rsync -a --append source-file destination

If you want to see the progress, add the --progress option to the command.

alt text

2
  • 6
    The -append option seems to be the lynch-pin to the "Resume"... but is there an elegant way to "Pause" rsync, other than Ctrl+C? ... and can rsync resume accurately, after something dramatic.. eg. a power-out?
    – Peter.O
    Dec 17, 2010 at 7:57
  • If from coming from google in 2016, one way would be to launch the rsync command as a process from python or similar and monitor the process while reading its output. Then you can trigger a SIG/signal against the process. A sh file should be able to do this i would think
    – Angry 84
    Oct 11, 2016 at 7:12
4

short answer, need no installation, to pause use kill -STOP PID
to continue paused process use kill -CONT PID
where PID is Process ID. you can get PID by running System monitor or top command

2

I can answer only the part about the difference between terminal and nautilus. I have checked several times this. It appears copying from terminal is faster than any graphical way like nautilus. At least in my case, when i copy about 32GB of info, it takes about 3 to 5 minutes less from terminal than nautilus from a 25 minute copy. that is about 10%-20% of the time. About a way to resume a copy to your external unit i think curl or rsync would resume a failed copy. At least with cp command. I have not tried this myself (I will try tomorrow) but this two might work.

For curl you need to aptitude install curl or apt-get instal curl since it does not come with ubuntu by default.

Use curl --help or rsync --help to find out more. Tomorrow i will show how to copy with both if you could not find the way.

0

I would also recommend rsync, but with the --partial option, this way it checks the already transferred data. You could even use it to repair a more or less fully transferred file which has a corruption somewhere in between.

rsync -v --info=progress2 --partial source destination

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .