This question already has an answer here:
I get this after rsync the .sh file to the server:
sudo: unable to execute ./run_vps_post_config.sh: No such file or directory
To fix, I open the file with winscp and save it. Then it runs again. (this is nothing to do with permissions. It runs ok.)
Same thing happens when I zip->rsync->unzip. However if I unzip with -aa option (treat ALL files as text), then it is OK.
I looked in rsync for a similar option to treat files as text, but none was found.