rsync "cannot delete non-empty directory:"

Red Squirrel

[H]F Junkie
Joined
Nov 29, 2009
Messages
9,211
I noticed that every now and then, my backups will start failing because I run out of disk space, then I find out that I get tons of these rsync errors:

cannot delete non-empty directory: [folder name]

Rsync is suppose to delete files that no longer exist in the source, I don't care if the folder is not empty in the destination, if it's gone in the source, then I want rsync to delete it. Why is it that it does this?

This is the rsync command I use:

Code:
rsync -vrbupoglc --delete-delay --exclude-from="exclude.txt" ${baksource} /mnt/rembackupdisk/bakdata/ | grep -vi "skipping "

baksource is the source folder. Any help getting this to work properly would be appreciated, thanks.
 
Are you doing something with your exclude list? If you exclude a file, and rsync tries to delete the dir its in, you get an error. THere is a delete-excluded option if you just want it to delete that stuff... but why would it be excluded then?
 
It could be, maybe it's an excluded I added later on, so it was already backed up now it refuses to delete it because it's in the exclude list, does that make sense?

I'll try the delete-excluded and see how that goes next time I run a backup.
 
I know this is an old thread, but I was having the problem again, and forgot about it and googled it and found it. Just for the record, Adding --delete-excluded fixes this issue.
 
Back
Top