Errror: bash: rsync: command not found

I gave this error: Errror: bash: rsync: command not found My gitlab-ci.yml:

image: debian:latest
deploy:
  before_script:
   - 'command -v ssh-agent > /dev/null || ( apt-get update -y && apt-get install openssh-client rsync -y )'
   - eval $(ssh-agent -s)
   - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
   - mkdir -p ~/.ssh
   - chmod 700 ~/.ssh
   - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\nPort $SSH_PORT" > ~/.ssh/config'
  tags:
   - win
   - runner
   - do
  script:
   - rsync -ru -e 'ssh -v' --exclude='.git' --exclude '.gitlab-ci.yml' $(pwd) $SSH_USER@$SSH_SERVER:~
   #- scp -r $(pwd) $SSH_USER@$SSH_SERVER:~
  only:
    - stage

Screenshot_20200920_231553

scp -r $(pwd) $SSH_USER@$SSH_SERVER:~ If enable this line, it is work but - rsync -ru -e 'ssh -v' --exclude='.git' --exclude '.gitlab-ci.yml' $(pwd) $SSH_USER@$SSH_SERVER:~ this indicates that rsync is not installed. but it is actually installed

I tried to specify the full path to rsync, but it didn't help either

Screenshot_20200920_232039

Runner config:

Screenshot_20200920_232939

Please help me.

Thanks in advance

Edited by Vasia Pupkin