I need to interrupt and restart a Linux copy operation. What is the best way to do this?
I'm currently in the process of copying data from one Debian PC to another. I started this via sshfs
and tar
as follows, but there are no requirements to use sshfs
nor tar
if another reliable way will suffice:
local$ mkdir /path/to/remote-sdb1
local$ sshfs root@remote:/mnt/sdb1 /path/to/remote-sdb1
local$ tar cf - /path/to/local/data/to/copy | tar xf - -C /path/to/remote-sdb1 &
The remote box is a one-time boot of System Rescue CD with no local operating system and inside my firewall, so I'm not too concerned about logging-in as root until someone comments otherwise.
This is taking longer than I originally expected, so I need to interrupt the operation to power down the remote box for a few minutes.
When I power it back up, I know I can't resume the tar operations; instead, is there something like an rsync
command that will let me resume easily from where I left off and finish the transfer, including completing the botched transfer of the file in-progress at the point I interrupt the operation?
After this completes, I plan to run the rsync
command in this answer to verify the transfer completed successfully, unless someone recommends this is redundant:
local$ rsync -niaHc /path/to/local/data/to/copy/ /path/to/remote-sdb1/path/to/local/data/to/copy
(As stated in the post, I need to be careful to end the first folder name with a /
.)