# Impossible to find rsync if it's not in /usr/bin/ directory

**URL:** <https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711>\
**Category:** Get Help\
**Tags:** rsync, ansible, ubuntu\
**Created:** [July 3, 2025, 8:22am UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711 "2025-07-03T08:22:38Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![a\_m](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/a_m/32/11175_2.png) [@a\_m](https://forum.ansible.com/u/a_m)\
**Post date:** [July 3, 2025, 8:22am UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/1 "2025-07-03T08:22:38Z")

</div>

hello  
, i can’t see rsync from my computer to remote server.if it’s not in `/usr/bin` directory.  
my rsync binary compiled from repo github [https://github.com/RsyncProject/rsync](https://rsync) is installed in `/usr/local/bin` directory  
my rsync version is : `alexandre@ubuntu:~/rsync$ rsync rsync version 3.4.1-8-g9994933c protocol version 32 Copyright (C) 1996-2025 by Andrew Tridgell, Wayne Davison, and others. Web site: https://rsync.samba.org/ `, so : " `3.4.1-8-g9994933c`"  
because , i have to create symbolink link and i show you my `~/.bashrc` with precisely `export` instructions file :

```auto
export CC=clang-18
export CXX=clang++-18
export NVM_DIR="$HOME/.nvm"
export PATH="$HOME/.symfony5/bin:$HOME/.cargo/bin:/usr/bin:$HOME/.cargo/env:$JAVA_HOME/bin:$PATH"
export PATH="/usr/local/:/usr/suricata/bin:$PATH"
export LIBDIR=/usr/local/lib:/usr/lib/x86_64-linux-gnu:/usr/lib:/lib/x86_64-linux-gnu
export CPPFLAGS="-I/usr/local/include"
export LDFLAGS="-L/usr/local/lib"
export SSLKEYLOGFILE="/home/alexandre/sslkey.log"

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=$LIBDIR:$LD_LIBRARY_PATH
export LD_RUN_PATH=$LIB_DIR:$LD_RUN_PATH

```

il would like to have better and properly solution  
could you help me ?  
Regards

---

<div class="post-metadata">

**Author:** ![Thulium-Drake](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/thulium-drake/32/833_2.png) [@Thulium-Drake](https://forum.ansible.com/u/Thulium-Drake)\
**Post date:** [July 3, 2025, 9:01am UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/2 "2025-07-03T09:01:37Z")

</div>

Your `PATH` export only contains `/usr/local`, not `/usr/local/bin`, you might want to fix that 🙂

---

<div class="post-metadata">

**Author:** ![a\_m](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/a_m/32/11175_2.png) [@a\_m](https://forum.ansible.com/u/a_m)\
**Post date:** [July 3, 2025, 9:07am UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/3 "2025-07-03T09:07:04Z")

</div>

no it doesn’t work because `/usr/local` contains `/usr/local/bin`  
Regards

---

<div class="post-metadata">

**Author:** ![a\_m](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/a_m/32/11175_2.png) [@a\_m](https://forum.ansible.com/u/a_m)\
**Post date:** [July 3, 2025, 1:09pm UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/4 "2025-07-03T13:09:21Z")

</div>

it’s _not urgent_ !

but i show you my logs :

```auto
alexandre@ubuntu:~/rsync$ ./configure
checking for gcc... clang-18
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether clang-18 accepts -g... yes
checking for clang-18 option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for utime.h... yes
checking whether byte ordering is bigendian... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/fcntl.h... yes
checking for sys/select.h... yes
checking for fcntl.h... yes
checking for sys/time.h... yes
checking for sys/unistd.h... yes
checking for unistd.h... (cached) yes
checking for utime.h... (cached) yes
checking for compat.h... no
checking for sys/param.h... yes
checking for ctype.h... yes
checking for sys/wait.h... (cached) yes
checking for sys/stat.h... (cached) yes
checking for sys/ioctl.h... yes
checking for sys/filio.h... no
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for sys/socket.h... yes
checking for sys/mode.h... no
checking for grp.h... yes
checking for sys/un.h... yes
checking for sys/attr.h... no
checking for arpa/inet.h... yes
checking for arpa/nameser.h... yes
checking for locale.h... yes
checking for sys/types.h... (cached) yes
checking for netdb.h... yes
checking for malloc.h... yes
checking for float.h... yes
checking for limits.h... yes
checking for iconv.h... yes
checking for libcharset.h... no
checking for langinfo.h... yes
checking for mcheck.h... yes
checking for sys/acl.h... yes
checking for acl/libacl.h... yes
checking for attr/xattr.h... yes
checking for sys/xattr.h... yes
checking for sys/extattr.h... no
checking for dl.h... no
checking for popt.h... no
checking for popt/popt.h... no
checking for linux/falloc.h... yes
checking for netinet/in_systm.h... yes
checking for netgroup.h... no
checking for zlib.h... yes
checking for xxhash.h... yes
checking for openssl/md4.h... yes
checking for openssl/md5.h... yes
checking for zstd.h... yes
checking for lz4.h... yes
checking for sys/file.h... yes
checking for bsd/string.h... yes
checking for netinet/ip.h... yes
checking whether sys/types.h defines makedev... no
checking for sys/mkdev.h... no
checking for sys/sysmacros.h... yes
configure.sh: Configuring rsync 3.4.2dev
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking whether to include debugging symbols... yes
checking for gcc... (cached) clang-18
checking whether the compiler supports GNU C... (cached) yes
checking whether clang-18 accepts -g... (cached) yes
checking for clang-18 option to enable C11 features... (cached) none needed
checking how to run the C preprocessor... clang-18 -E
checking whether the compiler supports GNU C++... yes
checking whether clang++-18 accepts -g... yes
checking for clang++-18 option to enable C++11 features... none needed
checking for gawk... gawk
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a BSD-compatible install... /usr/bin/install -c
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for perl... /usr/bin/perl
checking for python3... /usr/bin/python3
checking if md2man can create manpages... yes
checking if we require man-page building... optional
checking for remsh... 0
checking for sh... /usr/bin/sh
checking for fakeroot... /usr/bin/fakeroot
checking the group for user "nobody"... nogroup
checking whether to enable rolling-checksum SIMD optimizations... yes (x86_64)
checking if assembler accepts noexecstack... yes
checking for broken largefile support... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking whether to enable ipv6... yes
checking whether to call shutdown on all sockets... no
checking whether to use included zlib... ./zlib
checking whether to enable use of openssl crypto library... yes
checking for library containing EVP_MD_CTX_copy... -lcrypto
checking whether to enable MD5 ASM optimizations... no
checking whether to enable rolling-checksum ASM optimizations... no
checking whether to enable xxhash checksum support... yes
checking for library containing XXH64_createState... -lxxhash
checking whether to enable zstd compression... yes
checking for library containing ZSTD_minCLevel... -lzstd
checking whether to enable LZ4 compression... yes
checking for library containing LZ4_compress_default... -llz4
checking if makedev takes 3 args... no
checking size of int... 4
checking size of long... 8
checking size of long long... 8
checking size of short... 2
checking size of int16_t... 2
checking size of uint16_t... 2
checking size of int32_t... 4
checking size of uint32_t... 4
checking size of int64_t... 8
checking size of off_t... 8
checking size of off64_t... 8
checking size of time_t... 8
checking size of char*... 8
checking for inline... inline
checking for long double with more range or precision than double... yes
checking for uid_t in sys/types.h... yes
checking for mode_t... yes
checking for off_t... yes
checking for size_t... yes
checking for pid_t... yes
checking for id_t... yes
checking type of array argument to getgroups... gid_t
checking for struct stat.st_rdev... yes
checking for struct stat.st_mtimensec... no
checking for struct stat.st_mtimespec.tv_nsec... no
checking for struct stat.st_mtim.tv_nsec... yes
checking for socklen_t... yes
checking for errno in errno.h... yes
checking for connect... yes
checking for library containing inet_ntop... none required
checking for library containing iconv_open... none required
checking for library containing libiconv_open... no
checking for iconv declaration... 
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for inet_ntop... yes
checking for inet_pton... yes
checking for struct addrinfo... yes
checking for struct sockaddr_storage... yes
checking whether defines needed by getaddrinfo exist... yes
checking for getaddrinfo... yes
checking for struct sockaddr.sa_len... no
checking for struct sockaddr_in.sin_len... no
checking for struct sockaddr_un.sun_len... no
checking for struct sockaddr_in6.sin6_scope_id... yes
checking for struct stat64... yes
checking for strcasecmp... yes
checking for aclsort... no
checking for aclsort in -lsec... no
checking whether utime accepts a null argument... yes
checking for size_t... (cached) yes
checking for working alloca.h... yes
checking for alloca... yes
checking for waitpid... yes
checking for wait4... yes
checking for getcwd... yes
checking for chown... yes
checking for chmod... yes
checking for lchmod... yes
checking for mknod... yes
checking for mkfifo... yes
checking for fchmod... yes
checking for fstat... yes
checking for ftruncate... yes
checking for strchr... yes
checking for readlink... yes
checking for link... yes
checking for utime... yes
checking for utimes... yes
checking for lutimes... yes
checking for strftime... yes
checking for chflags... no
checking for getattrlist... no
checking for mktime... yes
checking for innetgr... yes
checking for linkat... yes
checking for memmove... yes
checking for lchown... yes
checking for vsnprintf... yes
checking for snprintf... yes
checking for vasprintf... yes
checking for asprintf... yes
checking for setsid... yes
checking for strpbrk... yes
checking for strlcat... yes
checking for strlcpy... yes
checking for stpcpy... yes
checking for strtol... yes
checking for mallinfo... yes
checking for mallinfo2... yes
checking for getgroups... yes
checking for setgroups... yes
checking for geteuid... yes
checking for getegid... yes
checking for setlocale... yes
checking for setmode... no
checking for open64... yes
checking for lseek64... yes
checking for mkstemp64... yes
checking for mtrace... yes
checking for va_copy... no
checking for __va_copy... no
checking for seteuid... yes
checking for strerror... yes
checking for putenv... yes
checking for iconv_open... yes
checking for locale_charset... no
checking for nl_langinfo... yes
checking for getxattr... yes
checking for extattr_get_link... no
checking for sigaction... yes
checking for sigprocmask... yes
checking for setattrlist... no
checking for getgrouplist... yes
checking for initgroups... yes
checking for utimensat... yes
checking for posix_fallocate... yes
checking for attropen... no
checking for setvbuf... yes
checking for nanosleep... yes
checking for usleep... yes
checking for setenv... yes
checking for unsetenv... yes
checking for useable fallocate... yes
checking for FALLOC_FL_PUNCH_HOLE... yes
checking for FALLOC_FL_ZERO_RANGE... yes
checking for SYS_fallocate... yes
checking whether posix_fallocate is efficient... no
checking for getpgrp... yes
checking for tcgetpgrp... yes
checking whether getpgrp requires zero arguments... yes
checking whether chown() modifies symlinks... no
checking whether link() can hard-link symlinks... yes
checking whether link() can hard-link special files... yes
checking for working socketpair... yes
checking for getpass... yes
checking for poptGetContext in -lpopt... no
checking whether to use included libpopt... ./popt
checking for unsigned char... yes
checking for broken readdir... no
checking for utimbuf... yes
checking if gettimeofday takes tz argument... yes
checking for C99 vsnprintf... yes
checking for secure mkstemp... yes
checking if mknod creates FIFOs... yes
checking if mknod creates sockets... yes
checking whether -c -o works... yes
checking for _acl... no
checking for __acl... no
checking for _facl... no
checking for __facl... no
checking whether to support ACLs... running tests:
checking for acl_get_file in -lacl... yes
checking for ACL support... yes
checking ACL test results... Using posix ACLs
checking for acl_get_perm_np... no
checking whether to support extended attributes... Using Linux xattrs
checking for getxattr in -lattr... yes
configure.sh: creating ./config.status
config.status: creating Makefile
config.status: creating lib/dummy
config.status: creating zlib/dummy
config.status: creating popt/dummy
config.status: creating shconfig
config.status: creating config.h
config.status: config.h is unchanged

    rsync 3.4.2dev configuration successful

alexandre@ubuntu:~/rsync$ make
./mkgitver
sed 's;\@bindir\@;/usr/local/bin;g' <./stunnel-rsyncd.conf.in >stunnel-rsyncd.conf
Wrote: rsync.1.html
Wrote: rsync.1
Wrote: rsync-ssl.1.html
Wrote: rsync-ssl.1
Wrote: rsyncd.conf.5.html
Wrote: rsyncd.conf.5
alexandre@ubuntu:~/rsync$ sudo make install
[sudo] Mot de passe de alexandre : 
./mkgitver
/usr/bin/mkdir -p /usr/local/bin
/usr/bin/install -c -m 755 rsync /usr/local/bin
/usr/bin/install -c -m 755 ./rsync-ssl /usr/local/bin
/usr/bin/mkdir -p /usr/local/share/man/man1
/usr/bin/mkdir -p /usr/local/share/man/man5
if test -f rsync.1; then /usr/bin/install -c -m 644 rsync.1 /usr/local/share/man/man1; fi
if test -f rsync-ssl.1; then /usr/bin/install -c -m 644 rsync-ssl.1 /usr/local/share/man/man1; fi
if test -f rsyncd.conf.5; then /usr/bin/install -c -m 644 rsyncd.conf.5 /usr/local/share/man/man5; fi
if test "no" = yes; then \
    /usr/bin/install -c -m 755 rrsync /usr/local/bin; \
    if test -f rrsync.1; then /usr/bin/install -c -m 644 rrsync.1 /usr/local/share/man/man1; fi; \
fi
alexandre@ubuntu:~/rsync$ which rsync
/usr/local/bin/rsync
alexandre@ubuntu:~/rsync$ 
déconnexion
Connection to xx.xx.xx.xx closed.
aaaaa-alexandre@aaaaa-alexandre:~/Documents/AnalyticaTechCode$ cd ./ansible/
aaaaa-alexandre@aaaaa-alexandre:~/Documents/AnalyticaTechCode/ansible$ ansible-playbook ./playbookDeux.yml 

PLAY [servers] ************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************************************************************************************************************
ok: [ubuntu]

TASK [debug] **************************************************************************************************************************************************************************************************************
ok: [ubuntu] => {
    "msg": "Ansible version: 2.18.6"
}

TASK [Synchronize project files] ******************************************************************************************************************************************************************************************
fatal: [ubuntu -> localhost]: FAILED! => {"changed": false, "cmd": "sshpass -d4 /bin/rsync --delay-updates -F --compress --archive --rsh='/bin/ssh -S none -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null' --exclude=.git --exclude=*.sh --exclude=/vendor --exclude=var/cache/* --exclude=var/log/* --exclude=.env.local -v --out-format='<<CHANGED>>%i %n%L' /home/alexandre/Documents/AnalyticaTechCode/ alexandre@85.215.166.46:/var/www/AnalyticaTechCode", "msg": "Warning: Permanently added '85.215.166.46' (ED25519) to the list of known hosts.\r\n\nrsync: [sender] change_dir \"/home/alexandre/Documents/AnalyticaTechCode\" failed: No such file or directory (2)\nrsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1338) [sender=3.2.7]\n", "rc": 23}

PLAY RECAP ****************************************************************************************************************************************************************************************************************
ubuntu : ok=2 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0   

aaaaa-alexandre@aaaaa-alexandre:~/Documents/AnalyticaTechCode/ansible$ 

```

we can contact _rsync_ maintainers to improve **the repo** more later  
Regards

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [July 3, 2025, 2:31pm UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/5 "2025-07-03T14:31:06Z")

</div>

But you are getting a different error now:

> [@](#):
>
> `rsync: [sender] change_dir \"/home/alexandre/Documents/AnalyticaTechCode\" failed: No such file or directory (2)`

---

<div class="post-metadata">

**Author:** ![a\_m](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/a_m/32/11175_2.png) [@a\_m](https://forum.ansible.com/u/a_m)\
**Post date:** [July 6, 2025, 9:22am UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/6 "2025-07-06T09:22:50Z")

</div>

[FRA]  
mon dossier et fichier existe  
[ENG]  
my folder and file exists

---

<div class="post-metadata">

**Author:** ![a\_m](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/a_m/32/11175_2.png) [@a\_m](https://forum.ansible.com/u/a_m)\
**Post date:** [July 6, 2025, 11:34am UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/7 "2025-07-06T11:34:40Z")

</div>

[FRA]  
bonjour,  
j’ai trouvé ! on peut déjà modifier dans la MakeFile la ligne qu’il faut qui est le `prefix`, au tout début du fichier `MakeFile`, je n’arrive juste pas à faire un `sudo make uninstall`, mais ça , je l’ai demandé dans le repo github  
Cordialement  
[ENG]  
hello,  
I found it! we can already modify in the MakeFile the necessary line which is the `prefix`, at the very beginning of the file `MakeFile`, I just can’t manage to do a `sudo make uninstall`, but that, I asked for in the github repo  
Sincerely  
[DE]  
hallo,  
Ich habe es gefunden! man kann bereits in MakeFile die richtige Zeile ändern, das ist das `prefix`, ganz am Anfang der `MakeFile`-Datei kann ich einfach kein `sudo make uninstall` machen, aber das habe ich im Repo github angefordert  
Mit freundlichen Grüßen  
[SPA]  
buenos días,  
Lo he encontrado! ya se puede modificar en MakeFile la línea que se necesita que es el `prefix`, al principio del archivo `MakeFile`, no puedo hacer un `sudo make uninstall`, pero eso , lo pedí en el repositorio github  
Cordialmente  
[ITA]  
buongiorno,  
Ho trovato io! si può già modificare in MakeFile la riga necessaria che è il `prefix`, all’inizio del file `MakeFile`, non riesco a fare un `sudo make uninstall`, ma questo , l’ho chiesto nel repo github  
Cordialmente

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [July 6, 2025, 1:32pm UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/8 "2025-07-06T13:32:48Z")

</div>

> [@a\_m](#):
>
> my folder and file exists

It does on host `aaaaa-alexandre`, but not on the sending host (`ubuntu`?) apparently.

Could you post your `ansible.posix.synchronize` task? It would help to see what parameters you use and what they are set to.

---

<div class="post-metadata">

**Author:** ![a\_m](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/a_m/32/11175_2.png) [@a\_m](https://forum.ansible.com/u/a_m)\
**Post date:** [July 9, 2025, 1:56pm UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/9 "2025-07-09T13:56:20Z")

</div>

the “aaaaa” string is here to hide my lastname on my own computer, and alexandre@ubuntu`, is my remote server.

my yml code is :

```auto
 - name: Synchronize project files
      ansible.posix.synchronize:
        src: "{{ local_project_root }}/"
        dest: "{{ symfony_root }}"
        delete: no # Ne pas supprimer les fichiers qui n'existent pas dans la source
        rsync_opts:
          - "--exclude=.git"
          - "--exclude=*.sh"
          - "--exclude=/vendor"
          - "--exclude=var/cache/*" # Pour éviter de synchoniser le cache local
          - "--exclude=var/log/*" # Pour éviter de synchoniser les logs locaux
          - "--exclude=.env.local" # Pour préserver le fichier .env.local de prod
          - "-v"
      delegate_to: localhost
      become: no

```

regards

---

<div class="post-metadata">

**Author:** ![a\_m](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/a_m/32/11175_2.png) [@a\_m](https://forum.ansible.com/u/a_m)\
**Post date:** [July 9, 2025, 2:05pm UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/10 "2025-07-09T14:05:57Z")

</div>

i have a real problem i remove this part of yml _code_ :

```auto
    - name: Ensure correct permissions on symfony_root
      file:
        path: "{{ symfony_root }}"
        state: directory
        owner: alexandre
        group: www-data
        mode: '0775'
        recurse: yes

```

and i don’t know why ?  
Regards

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [July 9, 2025, 5:48pm UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/11 "2025-07-09T17:48:39Z")

</div>

Do you mean, you have a real problem _if_ you remove the above `file` task? (I ran the task with that group, owner, and `{{ symfony_root }}` defined, and the task itself works fine.) That would indicate that `{{ symfony_root }}` doesn’t exist on your target machine. (?)

How does the problem manifest? That is, what happens, or fails to happen, if you remove that task?

---

<div class="post-metadata">

**Author:** ![a\_m](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/a_m/32/11175_2.png) [@a\_m](https://forum.ansible.com/u/a_m)\
**Post date:** [July 9, 2025, 9:14pm UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/12 "2025-07-09T21:14:55Z")

</div>

yes ! i’ve this problem if i remove the `file` task ! i’m still looking into why there is problem with ansible script but my rsync binary, in my remote server is owned by:

```auto
alexandre@ubuntu:~$ sudo ls -la /usr/bin/rsync
[sudo] Mot de passe de alexandre : 
-rwxr-xr-x 1 root root 1640408 juil. 10 00:10 /usr/bin/rsync
alexandre@ubuntu:~$

```

and i still have the same problem with this _yml_ code:

```auto
- hosts: servers
  become: yes
  vars:
    symfony_root: /var/www/AnalyticaTechCode
    local_project_root: "/home/alexandre/Documents/AnalyticaTechCode"

  tasks:
    - debug:
        msg: "Ansible version: {{ ansible_version.full }}"

    - name: Ensure correct permissions on symfony_root
      file:
        path: "{{ symfony_root }}"
        state: directory
        owner: www-data
        group: www-data
        mode: '0755'
        recurse: yes

    - name: Synchronize project files
      ansible.posix.synchronize:
        src: "{{ local_project_root }}/"
        dest: "{{ symfony_root }}"
        compress: true
        delete: no # Ne pas supprimer les fichiers qui n'existent pas dans la source
        rsync_opts:
          - "--exclude=.git"
          - "--exclude=*.sh"
          - "--exclude=/vendor"
          - "--exclude=var/cache/*" # Pour éviter de synchoniser le cache local
          - "--exclude=var/log/*" # Pour éviter de synchoniser les logs locaux
          - "--exclude=.env.local" # Pour préserver le fichier .env.local de prod
          - "-v"
      delegate_to: localhost
      become: yes
      become_user: www-data

    - name: Clear Symfony cache
      become: yes
      become_user: www-data
      shell: cd {{ symfony_root }} && symfony console cache:clear --env=prod
      args:
        executable: /bin/bash

```

i will look that more precisely tomorrow  
Regards

---

<div class="post-metadata">

**Author:** ![a\_m](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/a_m/32/11175_2.png) [@a\_m](https://forum.ansible.com/u/a_m)\
**Post date:** [July 10, 2025, 9:35am UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/13 "2025-07-10T09:35:32Z")

</div>

[ENG]  
hello,  
that’s it I found!! unless you said it above and I misunderstood. I cannot send files, if I am not the same user who owns the folder as the one with which I send files, that is to say `alexandre`. It doesn’t matter which group has the project folders, before and after sending the files. I can only then put as owner user `www-data`, and `www-data` group owner, after sending the files!!  
Sincerely, Yours  
[FRA]  
bonjour,  
ça y est j’ai trouvé !! À moins que vous l’ayez dit plus haut et que j’ai mal compris. Je ne peux pas envoyer des fichiers ,si je ne suis pas le même utilisateur qui possède le dossier que celui avec lequel j’envoie des fichiers, c’est à dire `alexandre`. Le groupe possédant les dossier du projet n’a pas d’importance, avant et après avoir envoyé les fichiers. Je ne peux qu’ensuite mettre comme utilistateur propriétaire `www-data`, et `www-data` groupe propriétaire, après avoir envoyé les fichiers !!  
Cordialement Vôtre

---

<div class="post-metadata">

**Author:** ![a\_m](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/a_m/32/11175_2.png) [@a\_m](https://forum.ansible.com/u/a_m)\
**Post date:** [July 10, 2025, 2:02pm UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/14 "2025-07-10T14:02:12Z")

</div>

[FRA]  
je suis bête !! je n’ai qu’à me connecter avec l’utilisateur `www-data` , ça devrait être bon !!  
[ENG]  
I’m stupid !! I just have to connect with the user `www-data,` it should be good !!

---

<div class="post-metadata">

**Author:** ![a\_m](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/a_m/32/11175_2.png) [@a\_m](https://forum.ansible.com/u/a_m)\
**Post date:** [July 10, 2025, 2:32pm UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/15 "2025-07-10T14:32:33Z")

</div>

my ansible version is : `2.18.6`, and for `synchronization` task: `become_user: www-data` doesn’t work, but i don’t know why, see my script here :

```auto
  - name: Synchronize project files
      ansible.posix.synchronize:
        src: "{{ local_project_root }}/"
        dest: "{{ symfony_root }}"
        compress: true
        delete: no # Ne pas supprimer les fichiers qui n'existent pas dans la source
        rsync_opts:
          - "--exclude=.git"
          - "--exclude=*.sh"
          - "--exclude=/vendor"
          - "--exclude=var/cache/*" # Pour éviter de synchoniser le cache local
          - "--exclude=var/log/*" # Pour éviter de synchoniser les logs locaux
          - "--exclude=.env.local" # Pour préserver le fichier .env.local de prod
          - "-v"
      delegate_to: localhost
      become: yes
      become_user: www-data

```

Regards

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [August 9, 2025, 2:32pm UTC](https://forum.ansible.com/t/impossible-to-find-rsync-if-its-not-in-usr-bin-directory/43711/16 "2025-08-09T14:32:34Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
