I want to exclude from the sync ALL files that start with a dot, IOW hidden files. But using --exclude '.*' does funny things with directories (or at least I think it does). Is there a recognised correct way to do this? I thought --exclude '.???*' would avoid the directory issue by only excluding any dot file(dir) with a name longer than 2 characters. Not tried it yet, but would this be a good solution? Ken G i l l e t t _/_/_/_/_/_/_/_/
On Fri, Aug 19, 2011 at 5:47 PM, Ken Gillett <emailist at ukgb.net> wrote:> I want to exclude from the sync ALL files that start with a dot, IOW hidden files. But using --exclude '.*' does funny things with directories (or at least I think it does). Is there a recognised correct way to do this? > > I thought --exclude '.???*' would avoid the directory issue by only excluding any dot file(dir) with a name longer than 2 characters. Not tried it yet, but would this be a good solution?I think you need to specifically name the dot files you want to exclude, eg '.*.swp' will ignore vi/vim swap files. Bob Parker> > > > Ken ?G i l l e t t > > _/_/_/_/_/_/_/_/ > > > > > -- > Please use reply-all for most replies to avoid omitting the mailing list. > To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync > Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html >-- Scientific studies prove that scientists are whores just like the rest of us wage slaves.
On Fri, 19 Aug 2011 12:47:34 +0200 Ken Gillett wrote:> I want to exclude from the sync ALL files that start with a dot, IOW > hidden files. But using --exclude '.*' does funny things with > directories (or at least I think it does). Is there a recognised > correct way to do this?Using --exclude '.*' should work. Example: $ tree -a a a `-- b |-- bar `-- .foo 1 directory, 2 files $ rsync -vv -i -a --exclude '.*' a/ x sending incremental file list [sender] hiding file b/.foo because of pattern .* created directory x delta-transmission disabled for local transfer or --whole-file cd+++++++++ ./ cd+++++++++ b/ >f+++++++++ b/bar total: matches=0 hash_hits=0 false_alarms=0 data=0 sent 115 bytes received 38 bytes 306.00 bytes/sec total size is 0 speedup is 0.00 Francis Montagnac