Re: Rsync, how to include ~/.files but not ~/.dirs
On 2007-01-25 @ 04:05:25 (week 04) ][ wrote:
> Hi, 
> 
> Is there any way to tell rsync to backup all the . files under my home but
> no any . directories? E.g., .profile in, but .gconf/ & .gnome/ etc out?
> 
> FYI, I tried with the following exclude rules but it didn't work, . directories
> are still included.  
> 
>  rsync -vua --exclude-from=exclude.list 
> 
>  File exclude.list:
>  + /home/tong/.*
>  /home/tong/.*/
I'd suggest you take a look at the difference between * and **. A single
asterisk will match files, but not directories. A double asterisk will
match directories too. That's what I use in my includes file and it
works like a charm.
Of course I am cheating a little bit here by assuming their will only be
hidden directories beneath the first level in your home directory.
HTH
Grx HdV
Reply to: