exclude error "cannot match" but dir exists

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
RL
Reply | Threaded
Open this post in threaded view
|

exclude error "cannot match" but dir exists

RL
The source:

rufus@Air-PC:~/WK/testin> dir
total 628
-rw-r--r-- 1 rufus users     67 Feb 16 17:24 aud-link.txt
-rw-r--r-- 1 rufus users   3759 May  3 23:39 bad-world_rant.txt
-rw-r--r-- 1 rufus users   3981 Feb  9 13:00 bernie-rant.txt
-rw-r--r-- 1 rufus users 584635 Feb  3 16:13 bldg_bath_fans_FineHomeBuilding.pdf
drwxr-xr-x 3 rufus users   4096 Apr 17 17:01 dir1
drwxr-xr-x 2 rufus users   4096 May 11 08:03 dir2
drwxr-xr-x 6 rufus users   4096 May 12 17:07 dir3
drwxr-xr-x 2 rufus users   4096 May 12 08:16 dir4
-rw-r--r-- 1 rufus users      2 May 13 07:56 dummy
drwxr-xr-x 4 rufus users   4096 May 12 17:47 fldr-m-tst
-rw-r--r-- 1 rufus users      2 May 12 17:37 m
-rw-r--r-- 1 rufus users      2 May 12 17:18 m-tst.txt
-rw-r--r-- 1 rufus users      2 May 12 17:19 tst.m
-rw-r--r-- 1 rufus users      2 May 12 17:18 tst-m.txt
drwxr-xr-x 3 rufus users   4096 May 12 17:57 zfldr
rufus@Air-PC:~/WK/testin>

The commands that fail: (slight variations of wildcards and quotes and a relative path. The first example is the cleanest and simplest. The last example is using ** and it also fails.)

rufus@Air-PC:~/WK> rdiff-backup -v3   --include /home/rufus/WK/testin/dummy --exclude /rufus/home/WK/testin/dir3   /home/rufus/WK/testin    /home/rufus/WK/testout2
Found interrupted initial backup. Removing...
Fatal Error: Fatal Error: The file specification
    'b'/rufus/home/WK/testin/dir3''
cannot match any files in the base directory
    'b'/home/rufus/WK/testin''
Useful file specifications begin with the base directory or some
pattern (such as '**') which matches the base directory.

rufus@Air-PC:~/WK> rdiff-backup -v3   --include /home/rufus/WK/testin/dummy --exclude dir3   /home/rufus/WK/testin    /home/rufus/WK/testout2
Found interrupted initial backup. Removing...
Fatal Error: Fatal Error: The file specification
    'b'dir3''
cannot match any files in the base directory
    'b'/home/rufus/WK/testin''
Useful file specifications begin with the base directory or some
pattern (such as '**') which matches the base directory.

rufus@Air-PC:~/WK/testin> rdiff-backup -v3   --include /home/rufus/WK/testin/dummy --exclude /rufus/home/WK/testin/dir3?   /home/rufus/WK/testin    /home/rufus/WK/testout2
Found interrupted initial backup. Removing...
Fatal Error: Fatal Error: The file specification
    'b'/rufus/home/WK/testin/dir3?''
cannot match any files in the base directory
    'b'/home/rufus/WK/testin''
Useful file specifications begin with the base directory or some
pattern (such as '**') which matches the base directory.
rufus@Air-PC:~/WK/testin>

rufus@Air-PC:~/WK/testin> rdiff-backup -v3   --include /home/rufus/WK/testin/dummy --exclude /rufus/home/WK/testin/?dir3   /home/rufus/WK/testin    /home/rufus/WK/testout2
Found interrupted initial backup. Removing...
Fatal Error: Fatal Error: The file specification
    'b'/rufus/home/WK/testin/?dir3''
cannot match any files in the base directory
    'b'/home/rufus/WK/testin''
Useful file specifications begin with the base directory or some
pattern (such as '**') which matches the base directory.
rufus@Air-PC:~/WK/testin>

rufus@Air-PC:~/WK/testin> rdiff-backup -v3   --include /home/rufus/WK/testin/dummy --exclude '/rufus/home/WK/testin/*dir3'   /home/rufus/WK/testin    /home/rufus/WK/testout2
Found interrupted initial backup. Removing...
Fatal Error: Fatal Error: The file specification
    'b'/rufus/home/WK/testin/*dir3''
cannot match any files in the base directory
    'b'/home/rufus/WK/testin''
Useful file specifications begin with the base directory or some
pattern (such as '**') which matches the base directory.
rufus@Air-PC:~/WK/testin>

rufus@Air-PC:~/WK/testin> rdiff-backup -v3   --include /home/rufus/WK/testin/dummy --exclude **   /home/rufus/WK/testin    /home/rufus/WK/testout2
Fatal Error: Switches missing or wrong number of arguments
See the rdiff-backup manual page for more information.
rufus@Air-PC:~/WK/testin>


This makes no sense. The file "dummy" and the directory "dir3" exist in the base, but rdiff says "...dir3...cannot match". How is this possible?

And how is "--exclude **" (last example fail) wrong? Switches? Arguments?


Thanks for any help.
Rufus


Reply | Threaded
Open this post in threaded view
|

Re: exclude error "cannot match" but dir exists

David Precious-2
On Wed, 13 May 2020 09:41:31 -0500
RL <[hidden email]> wrote:

> The commands that fail: (slight variations of wildcards and quotes
> and a relative path. The first example is the cleanest and simplest.
> The last example is using ** and it also fails.)
>
> rufus@Air-PC:~/WK> rdiff-backup -v3
> --include /home/rufus/WK/testin/dummy
> --exclude /rufus/home/WK/testin/dir3   /home/rufus/WK/testin    /home/rufus/WK/testout2
> [...]
> Fatal Error: Fatal Error: The file specification
> 'b'/rufus/home/WK/testin/dir3'' cannot match any files in the base
> directory 'b'/home/rufus/WK/testin'' Useful file specifications begin
> with the base directory or some pattern (such as '**') which matches
> the base directory.


It's telling you what the problem is.

Look again at the paths - /home/rufus vs /rufus/home.

Reply | Threaded
Open this post in threaded view
|

Re: exclude error "cannot match" but dir exists

rdiff-backup-users mailing list
In reply to this post by RL
On Wed, 13 May 2020 at 15:42, RL <[hidden email]> wrote:

>
> rufus@Air-PC:~/WK/testin> rdiff-backup -v3   --include
> /home/rufus/WK/testin/dummy --exclude **   /home/rufus/WK/testin
> /home/rufus/WK/testout2
> Fatal Error: Switches missing or wrong number of arguments
> See the rdiff-backup manual page for more information.
> rufus@Air-PC:~/WK/testin>
>
> And how is "--exclude **" (last example fail) wrong? Switches? Arguments?
>

The shell will be expanding ** to all the files in the current
directory.  To see what is actually passed to the command run:

    echo MYCOMMANDLINE

To prevent the shell performing file name pattern matching expansion,
enclose that parameter in single quotes thus '**'.  I suggest you read
the EXPANSION section and Pattern Matching sub-section of the bash
manual.

    man bash


Mike