0

I'm attempting to backup a mounted drive on one system to another. In the past, we've used rsync which has mostly worked (but perhaps not always) but recently the source drive did not mount properly. When the rsync attempted the backup, it saw an empty directory and deleted all contents on the remote backup server. I'm wondering what the best way to handle this is? Perhaps our rsync command is not quite sufficient:

rsync -aqmz -e 'ssh -q' --delete /dir/ user@${DEST_IP}:/dir

The run of the above rsync command to the empty drive appears to hang and doesn't seem to be transferring any data.

The initial transfer is large (10-100s of GBs), but the subsequent deltas are not very large (100s of MBs).

We are using Ubuntu 20.04 on both systems.

3
  • well, obviously, --delete wasn't a good idea. Likely what you see as a hang is it scaning the source directory. I don't know why rsync does that when the target is empty, but it does.
    – user10489
    Mar 26, 2022 at 18:55
  • The reason for the delete was to have an exact copy, but noted.
    – Andrew
    Mar 26, 2022 at 18:58
  • Yup. You might want to consider running rsync with delete only manually and occasionally or something instead.
    – user10489
    Mar 26, 2022 at 19:11

1 Answer 1

2

Try replacing all the "quiet" options with "verbose" (-v) and add -P or --partial --progress, so you can see all the output. And add -n for a dry run that doesn`t actually manipulate the files on the destination. Like this:

rsync -avmnPz --delete /dir/ user@${DEST_IP}:/dir

That will give you an indication on where exactly the process is hanging and what is happening.

If this hangs for unknown reasons, there might be I/O issues while reading on one side (rsync still performs all the normal reads with -n) or there could also be network issues.

If this doesn't hang, but your normal rsync command still hangs, there could be I/O issues while writing at the destination.

You must log in to answer this question.

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