I'm not a big fan of scripts that remove history... Anyway, here's a possible fix.
Replace line 18-22 with this :
# remove files older than ${retention_days} days from the cache
for dir in "${data_path}"/cache/?/. ; do
if [ -e "$dir" ]
then
find "${data_path}"/cache/?/ -type f -mtime +${retention_days} -delete
break
fi
done
but is throws only three errors...
Either there is an error in one the paths or the wiki has never been accessed at all.