backup folder (rsync)
hi
i try to backup my home folder with rsync... in a script i have Code:
#!/bin/sh in my exclude.txt i have + /home/collinm/mp3 + /home/collinm/Download when i run the script, rsync copy all file .... it copy mp3 and Download folder..... but i don't want that.... any idea? thanks |
I don't have the computer on which I have installed rsync at hand, so just two wild guesses:
1. "+" in front of a rule usually means that the path is INcluded. Now I don't know if "+" in an EXclude file means exclude, or include. Intuitively I would say that in an exclude file reverse logic is true. However, just try the path without "+" and preceeded with "-" 2. When rsync descends into directories, the rule must still be true. That means that the path /home/collinm/mp3/hardrock does NOT match the rule /home/collinm/mp3. You would have to specify the rule as /home/collinm/mp3/* Only then every subdir matches your rule. Good luck, and sorry if I am wrong. jlinkels |
i tried with "+", "-" and nothing and get the same result
|
An "exclude file" defaults to the "-" operation if it is not specified whereas an "include file" defaults to "+". However, you can make an exclude file behave like an include file by prefacing the lines with a "+". This is exactly what you did. The converse is also true for an include file with "-" lines in it (this would behave like an exclude file).
Do not put those "+" signs in your exclude file. Replace: Code:
+ /home/collinm/mp3 Code:
/home/collinm/mp3 |
mp3/
Download/ work fine with that.... |
All times are GMT -5. The time now is 11:20 AM. |