I want to copy a folder to another location, while excluding some specific filesHere is my current script:#!/bin/bashif [ -n $2 ]then    source=$(readlink -f $1)    destination=$(readlink -f $2)else    printf \nProper syntax: my_copy source_folder destination_folder\n        exitfiparams=(    --exclude='.git'    --exclude='deploy'    --exclude='app/config/database.php'    --exclude='app/config/config.php')cd $sourcersync  -a ${params[@]} $source/* $destinationWhen I run my script, I get this error:rsync: link_stat -a --exclude=.git failed: No such file or directory (2)rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1070) [sender=3.0.9]What am I doing wrong?
How can I add an array of arguments inside my rsync call inside a script?
bash;rsync;bash script;array
To see what's happening change the rsync command to an echo command first. $ echo rsync \ -a ${params[@]} $source/* $destination\Potential FixesI would change that line to this instead:$ rsync -a ${params[@]} $source/* $destination