Reorganize the tmp and bak dirs.