I'm trying to automate some backups with rsync and have the following problem. I've got a file that contains some stuff to be excluded from the copying. Assume that the file has a single line
That I want rsync to do is to exclude any files or directory called 'exc' in the directory that I'm giving rsync. However, if we have the following tree:
./ | +---exc | file1 | +---directory + file2 | | +---exc file3
I hope the diagram is clear. What I want to happen is for the first exc to be excluded but for the second to be copied, while passing a file with the line exc will exclude both. There may be other files called exc at deeper levels so the line in the excludes file should point only to the root file exc.
What should the exclusion pattern look like?