Adding check for directory before rsync command