Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

rsync: cannot delete non-empty directory

Featured Replies

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?

  • Author

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.

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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.