Hi, I got a little question on the rsync-option include/exclude: I excluded all hidden files in my home-directory but I want two files to be included. I used following command: gregor@notebook:~> rsync -avzuPn -e ssh --exclude=.* --exclude=* --include=.kderc --include=.gaimrc /home/gregor/ 192.168.0.1:/home/gregor/ building file list ... 1 file to consider wrote 69 bytes read 20 bytes 178.00 bytes/sec total size is 0 speedup is 0.00 gregor@notebook:~> Why this transfer was not successful? The syntax is correct (I think). My general problem is, that I want to use an include-file, where also exludes are listed. Here's my file (base directory is /home/gregor/): - * - .* + .kde/share/apps/kabc/* + .kde/share/apps/kbear/* + .kde/share/apps/kopete/* + .kde/share/apps/korganizer/* + .kde/share/apps/quanta/* + .gaim/* + .gaimrc + .OpenOffice/user/config/* + .OpenOffice/user/wordbook/* What's wrong here?? Thanks for your support! -- Regards, Gregor http://linux.waluga.de
Gregor Waluga wrote:> Hi, > > I got a little question on the rsync-option include/exclude: > I excluded all hidden files in my home-directory but I want two files > to be included. I used following command: > > gregor@notebook:~> rsync -avzuPn -e ssh --exclude=.* --exclude=* > --include=.kderc --include=.gaimrc /home/gregor/ > 192.168.0.1:/home/gregor/ building file list ... > 1 file to consider > wrote 69 bytes read 20 bytes 178.00 bytes/sec > total size is 0 speedup is 0.00 > gregor@notebook:~> > > Why this transfer was not successful? The syntax is correct (I think). > > > My general problem is, that I want to use an include-file, where also > exludes are listed. Here's my file (base directory is /home/gregor/): > - * > - .* > + .kde/share/apps/kabc/* > + .kde/share/apps/kbear/* > + .kde/share/apps/kopete/* > + .kde/share/apps/korganizer/* > + .kde/share/apps/quanta/* > + .gaim/* > + .gaimrc > + .OpenOffice/user/config/* > + .OpenOffice/user/wordbook/* > > What's wrong here??You exclude everything on the first line. Rsync never looks beyond the initial exclude, because it matches _everything_. Max.
On Tue, Feb 18, 2003 at 01:04:28AM -0000, Max Bowsher wrote:> Gregor Waluga wrote: > > + .kde/share/apps/kabc/ > > + .kde/share/apps/kbear/ > > + .kde/share/apps/kopete/ > > + .kde/share/apps/korganizer/ > > + .kde/share/apps/quanta/ > > + .gaim/ > > + .gaimrc > > + .OpenOffice/user/config/ > > + .OpenOffice/user/wordbook/ > > - * > > - .* > > + .kde/share/apps/kabc/ > + .kde/share/apps/kabc/** > + .kde/share/apps/kbear/ > + .kde/share/apps/kbear/** > + .kde/share/apps/kopete/ > + .kde/share/apps/kopete/** > + .kde/share/apps/korganizer/ > + .kde/share/apps/korganizer/** > + .kde/share/apps/quanta/ > + .kde/share/apps/quanta/** > + .gaim/ > + .gaim/** > + .gaimrc > + .OpenOffice/user/config/ > + .OpenOffice/user/config/** > + .OpenOffice/user/wordbook/ > + .OpenOffice/user/wordbook/** > - * > > NB: * will match dotfiles. No need for .* as well. >Still need to add parent directories. + .kde/ + .kde/share/ + .kde/share/apps/ and + .OpenOffice/ + .OpenOffice/user/ otherwise * will exclude the parents before you traverse downward. Run with -vv to see rule application. -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt