check whether file/directory exists

If a user run copy-dir with a wrong path and "--delete", the worst outcome is that rsync will remove everything on the worker node including ssh configurations.