rsync command is not working when executing it from a remote host. Jenkins node tries to execute few commands on a remote server, but when running the rsync command I am getting below error
sh: rsync: not found.
The rsync command works successfully when I run directly on that server, but when I run it through ssh, it is giving the above error
This is the command that is failing
ssh root@"$build_server" "rsync -avzh $SRC_DIR/main $BUILD_DIR || exit 1"
I tried by giving the path of rsync but still the same error
ssh root@"$build_server" "rsync -avzh --rsync-path=/usr/local/bin/rsync $SRC_DIR/main $BUILD_DIR || exit 1"