in reply to rmtree() is failing after some time

answer here or here You can always use eval { rmtree ... }; to trap that failure.