Rsync script failing after update

The environment is Rocky Linux 8.6 and RHEL 8.6

I have the following bash code, which I run on RHEL, and the remote server, which has Rocky Linux.

rsync --inplace -l -a -t -r -v  -p -o -g --exclude-from $EXCLUDE_FILE --rsync-path="sudo rsync" $USER_AT_SERVER:$FOLDER_TO_BACKUP $BACKUP_FOLDER

This was working without any issues till about one and a half weeks ago.
Suddenly the script started failing every day.

with the error

rsync: change_dir "/home/user//{/etc," failed: No such file or directory (2)

All I did was do DNF updates.
Why is this code failing?

Hello @lee
The error you are describing usually occurs when the remote system does not have the directories. Check your remote and make sure those directories are there. The act of doing an update should not have broken this. Is it possible that something else happened as well?

I don’t know the reason either, but you have a for each task that you could do:

ROPT="--inplace -l -a -t -r -v -p -o -g"
for SRC in /etc /var
  rsync $ROPT  --exclude-from $EXCLUDE_FILE --rsync-path="sudo rsync" ${USER_AT_SERVER}:${SRC}/ ${BACKUP_FOLDER}${SRC}/

The solution for my case was

eval sudo rsync --inplace -l -a -t -r -v  -p -o -g --exclude-from $EXCLUDE_FILE --rsync-path=\"sudo rsync\" $USER_AT_SERVER:$FOLDER_TO_BACKUP $BACKUP_FOLDER

Missed the ‘sudo’ in the question.

Thanks to some troubleshooting by my co-workers (former and current).
@jlehtone I would have chosen your suggestion if ours did not work.
Thanks, everyone, for the suggestions.