I have a bash script that I want to use to synchronise the local changes I made to my wordpress site using the rsync command. However, when I try to run the file in the command line, it only displays the contents of the file?
The script:
#!/bin/bash echo "Deploying website” SOURCE_DIR=“/my/local/path/to/files” TARGET_DIR="/remote/dir/location" TARGET_SERVER=“user@server -pPORT” echo "Synchronising" echo "" # rsync to live server rsync --progress --exclude ‘wp-config.php’ --stats --archive -z --compress --delete -t $SOURCE_DIR $TARGET_SERVER:$TARGET_DIR echo "" echo "Done” As I said, when executing: sh ./sync.sh in the command line, it only displays the contents of the script.
Can anyone spot where I'm going wrong? (Obviously, I change the path names and server in real file)
I've set the permissions to 755 and running on OSX
Any help would be greatly appreciated, thanks.
./sync.sh?