Preparation of entanglement between atoms in spatially separated cavities via fiber loss