SOLVED Rsync write and mkdir failed

GoWilkes

Well-Known Member
Sep 26, 2006
692
33
178
cPanel Access Level
Root Administrator
I swear, I just can't make any progress >:-(

So as I'm transferring to my new VPS, I realize that my old VPS is totally out of storage. I need to transfer 40G but only have 1.2G left on the old VPS! But it does have a backup drive installed, so I'd like to move data from the accounts that are already transferred to that second drive... just to make sure everything's good until the end of the month.

I have one account with 22G of data in their /mail/ directory, so that's the first one I want to backup. I ran (with "example" shown here in place of the real account name):

Code:
# using -z for compression
# rsync -avuz --progress /home/example/mail/ /new100GBDisk/home/example/
sending incremental file list
rsync error: errors with program diagnostics (code 13) at log.c(235) [sender=3.0.6]

# not using -z
# rsync -avu --progress /home/example/mail/ /new100GBDisk/home/example/
sending incremental file list
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: mkdir "/new100GBDisk/home/example" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(576) [receiver=3.0.6]
rsync: connection unexpectedly closed (9 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(600) [sender=3.0.6]
I know that I can access /new100GBDisk/ via SSH and FTP, and that's the path to the second drive. It was only installed a few weeks ago and hasn't been used, but I double checked and could upload a simple text file to it via SFTP while logged in as root. So I don't think it's an issue of permissions or not being able to write to it.

The errors also popped up immediately, so it's not like it tried to write and gave up.

Any thoughts?
 
Last edited by a moderator:

GoWilkes

Well-Known Member
Sep 26, 2006
692
33
178
cPanel Access Level
Root Administrator
Nevermind, I manually created the directory and then it worked. I read old articles (2013-ish) that said you had to create it manually, but then newer articles that said you didn't, so it was confusing... maybe my server has an old version of rsync on it?

I know that /new100GBDisk/home/ didn't exist, either, which would explain why "mkdir "/new100GBDisk/home/example" failed; it wasn't creating the entire tree. I also read that the -R (--relative) option would create the full tree, but you had to somehow "use . to anchor the starting parent directory"... I'm not entirely sure that I understand that, though:


Either way, it's all good now unless someone wants to reply for future readers with a better explanation on how to force it to create the full tree.