When executing a command over SSH, you need to escape any special characters that should not be evaluated locally. Escape the backticks to have them evaluated on the remote server:
ssh $REMOTE_USER@${SUPPORTED_SERVERS[$i]} "gtar -zcvf $TAR_FILE \`find $LOCAL_PATH -name *$DATE*\`
Assuming $TAR_FILE
, $LOCAL_PATH
and $DATE
are local variables, otherwise escape them also. (They would need to exist as environment variables on the remote server)
Alternative
Like @RobinGreen points out: It is often better to make a script on the remote server and execute that over SSH.
#!/bin/sh
# This is the remote script
# Use positional arguments $1 - $3 and make a tarball
gtar -zcvf $1 $(find $2) -name "*$3*"
Call it like this
ssh $REMOTE_USER@${SUPPORTED_SERVERS[$i]} "/path/to/remote/script $TAR_FILE $LOCAL_PATH $DATE"