Unexpected remote arg when using link-dest in rsync

I have a backup script on my WSL Ubuntu that I use manually to backup my linux systems to a USB drive (NTFS volume mounted on WSL).

I'm running into an issue with --link-dest that I haven't had before in other backup scripts; but it's been a while since I've written anything in bash.

rsync --progress -rlDvuRH --modify-window=1 link-dest=$LAST/ -e "ssh -i /home/username/.ssh/id_rsa" --exclude='*home/.ecryptfs*' --exclude='*files_trashbin*' --exclude='*files_version*' root@hostname:{/var/www/,/root/,/home/,/etc/,/mnt/nfs/,/mnt/backupstore/} /home/username/rsync-backup/$DATE/

$LAST is the last backup destination directory that succeeded, this variable works out fine when I echo it to the console.

This gives me the error: Unexpected remote arg: root@hostname:/var/www/

If I use the exact some rsync command, but without the --link-dest parameter; there's no problems at all and it makes a full backup. What am I overlooking? Is it that the {} notation I use has some weird interactions with --l


rsync ... --modify-window=1 link-dest=$LAST/ ...

You forgot the --, it should be --link-dest=DIR. BTW, are you sure your $LAST variable is set?