The code should definitely log error if folder already exists and is not a symlink pointing to the same folder (which would be the case if command has already been executed).