cannot delete folder because of orphan file.acl
#2 (comment 292729322) error 409 : cannot delete folder : file as been deleted but not file.acl
This a known problem when deleting files with .acl, and only deleting the files, there remains files.acl. Folder is not void and cannot be deleted. The atomic deletion is to be implemented in NSS in the future.
We should find a procedure to delete/rename orphans files.acl, so as to allow folder deletion.
the procedure should :
-
find . -name "*?.acl" ! -name "serverSide.ttl.acl"
=> finds all file.acl (except "serverSide.ttl.acl") - check if
file.acl
relates tofile
orfile$.any_ext
( among othercard$.ttl
shall not be deleted) => if file exists do nothing
find . -name "*?.acl" ! -name "serverSide.ttl.acl" -type f -exec bash -c '[[ -e "${1%.acl}" ]] || (ls "${1%.acl}"$.* >/dev/null 2>$1) || "$1"' orphanAcl {} \;
- Finally rm or mv the orphan file.acl
find . -name "*?.acl" ! -name "serverSide.ttl.acl" -type f -exec bash -c '[[ -e "${1%.acl}" ]] || (ls "${1%.acl}"$.* >/dev/null 2>$1) || ("renamed from $1 to *.txt"; mv -f -- "$1" "${1}.txt")' orphanAcl {} \;