I am using the following rsync command:
sudo rsync --delete --exclude=disks --exclude=linux-6* --exclude=*.img --exclude=/data/data/* -av /data/ root@main:/data | grep -v /$ | grep -v .FCStd1$ | grep -v ~$ >> $file
It’s part of a larger backup script which defines the $file variable. The script runs fine except that the /data/data directory is synced in spite of it’s exclusion. The other excluded directories don’t sync as expected so why is that one syncing? I notice the /* on the end of the path, but wouldn’t that exclude all directories in that path as expected? What’s wrong here?