I've had a command in a script which I used a lot for a couple years. I didn't use the script for the last year, but today I ran it again. I'm suddenly having trouble excluding files from an rsync though.
I'm on Ubuntu 18.04 (rsync version 3.1.2) and I run the following command:
rsync -exclude-from='sync_exclude.txt' -azvv -e ssh '.' [email protected]:~/wp
where the sync_exclude.txt
file looks like this:
$ cat sync_exclude.txt
.idea
.git
.gitignore
.DS_Store
sync_exclude.txt
ansible/*
.env
But to my surprise the rsync now also syncs all the things in this exclude file.
I've tried other variations, such as
rsync -exclude=.git/ -azvv -e ssh '.' [email protected]:~/wp
rsync -exclude=".git/" -azvv -e ssh '.' [email protected]:~/wp
rsync -exclude=/.git/ -azvv -e ssh '.' [email protected]:~/wp
rsync -exclude=/.git/* -azvv -e ssh '.' [email protected]:~/wp
rsync -exclude /.git/ -azvv -e ssh '.' [email protected]:~/wp
rsync -exclude /.git/* -azvv -e ssh '.' [email protected]:~/wp
rsync -exclude="/.git/*" -azvv -e ssh '.' [email protected]:~/wp
rsync -exclude "/.git/*" -azvv -e ssh '.' [email protected]:~/wp
rsync -exclude={.git/,"ansible/*"} -azvv -e ssh '.' [email protected]:~/wp
rsync -exclude {.git/,"ansible/*"} -azvv -e ssh '.' [email protected]:~/wp
etc.
But none of them exclude the .git/
or the ansible/
folder. I've also tried on MacOS, but I have the same problem there.
I'm banging my head against the wall why none of this would suddenly work anymore.
Could anybody help me out of my misery?