sonofdbn Posted August 22, 2023 Share Posted August 22, 2023 I'm trying to use rsync to backup from one unRAID server to another, just using the terminal. I've mounted the destination share using Unassigned Devices, and the command is basically: rsync -avP --delete /mnt/user/Nextcloud/username/files/ /mnt/remotes/Backup_server/Nextcloud/username/files It largely works, but I ran into a problem with an error message saying "cannot delete non-empty directory". Previously I had backed up a sub-directory a few levels down in a folder called custom_banners/__MACOSX (if this looks familiar it's from SpaceInvader). I subsequently deleted this sub-directory on my main server, and now when I run the rsync command above I get the non-empty directory error message, saying it can't delete this directory and its sub-directories. I tried --delete-during as a parameter, but that didn't make a difference. I also get some error messages like this: rsync: [receiver] rename "/mnt/remotes/Backup_server/Nextcloud/username/files/Documents/2021/moroccan-flower/__MACOSX/._moroccan-flower.jM0wjF" -> "Documents/2021/moroccan-flower/__MACOSX/._moroccan-flower": No such file or directory (2) When I check the destination server, that directory does exist, so not sure what's happening here. I don't know if it's just coincidental that both issues involve a "__MACOSX" directory. I think what I'm trying to do is quite simple; I'm not doing anything with Nextcloud when running rsync - and I've tried various times and always get the same issues with the same files and directories. How can I fix this? Quote Link to comment
sonofdbn Posted August 30, 2023 Author Share Posted August 30, 2023 I don't have a definitive answer, but I think the problem might have been self-inflicted. I deleted the MACOSX folder on the server, rather than on the PC, and since the files were still on the PC, Nextcloud might have tried to sync them back before the rsync. Hence the files, or maybe temporary Nextcloud sync ones, were still there in the directory on the server, and some files there were still synced to the backup by rsync, resulting in the non-empty directories that couldn't be deleted. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.