Thanks to everyone who offered help. I managed to sort it by deleting some
files with . at the start. Because I deleted several files in batches I suspect
it was the hidden session files that was causing the grief so when I got rid of
those the problem went away as well