include/exclude: I miss the point
soltys at ziu.info
Fri Sep 10 16:43:49 MDT 2010
On 10-09-10 21:13, Hans Troost wrote:
> So my exclude-files contains:
> the include file contains:
> 1. Success: 2 .kde4/share/apps/kabc-files
Are you sure about that part ? '.*' ('H, .*' as seen by sending rsync)
should short-circuit any .kde/ directory subtree and exclude it from
file list/transfer. You would need something more elaborate to get just
those two fles from .kde4 and nothing else.
Anyway, putting that detail aside and if I'm reading things right.
Your rules (combined) look like:
+, * (implicit final rule)
H - because you added --delete-excluded, so receiving side will not
protect them from deletion.
For receiving rsync that means just:
R, * (as "consider everything not part of the transfer a candidate to
For sending rsync:
H, .* <- this makes following 2 rules redundant
S, * (implicit final rule)
Which does exactly what you experienced:
> 3. Failure: I have all other files, sub-dirs and their content as well in
They were all caught by the final implicit include, and none of them
matched your H (exclude) rules.
> 4. when adding
> to the exclude file this folders are not in, but the "normal"
> .mozilla/firefox/plp6wzjm.default/ files are.
Being part of exclude rules, they will be catched and excluded from
transfer, but the rest will not.
Note, that nothing from .mybackup that matches H (exclude) rules will be
> Question: it seems that I miss the point how to do this. can you please
> give a hint about what I ḿ doing wrong?
> rsync command )some date-time variable for files, but that is working):
> rsync -axhhX --no-perms --omit-dir-times\
> --backup --backup-dir=$NiceDate/updated --suffix=.$Now\
> --delete --delete-excluded\
> --backup-dir-dels=$NiceDate/deleted --suffix-dels=.`date +%H%M`\
> /home/hans /mnt/backup
> 2nd, similar question:
> to play around with this stuff I wanted to test with the hidden files only
> (.*), so I tried to add all non-hidden directories and normal files to this
> exclude-test.txt, but did not get it working (it worked too much):
> while my include-test is:
> In this case I don't get any files backed up (dry-run, so checked in log-file
Hmm, you should get
backed up. Otherwise the rest will be hidden from transfer (to be
precise, any file/directory starting with a letter or .).
More information about the rsync