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
exc
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?
rsyncprocess to use 2. Please can you edit your question to show thersynccommand you've tried. The reason for this is to give us a hook on which we can build our changes/solutions. 3. Please clarify (in your question) what criteria determine that oneexcshould be excluded but the other one can be included