0

alt texti execute the following command :-find / -type f -name fs-type -exec svnlook tree {} \; |egrep "/$"

the result is svnlook: Can't open file '/var/lib/svn/repos/b1me/products/payone/generic/code/core/db/fs-type/format': Not a directory svnlook: Can't open file '/var/lib/svn/repos/b1me/products/payone/generic/code/fees/db/fs-type/format': Not a directory

maybe we must make "find" command give us path without "db/fs-type/format" in other words we must clipping the output of "find command".... but how i can do this ???

2
  • Please use proper formatting in your texts. It's really hard to read otherwise.
    – joschi
    Sep 20, 2010 at 7:03
  • 1. i want find all repository .... 2. i want find entire directory for all repository .... note : the result of execute step one more than 500 repositoy so i need method to execute step two by easy method Sep 20, 2010 at 9:27

3 Answers 3

2

It is not the find command that is at fault here. The find command is doing exactly what you are telling it to do e.g. it is finding all occurrences of the regulare file named fs-type in the whole of your filesystem.

You are then passing the results of the find command to svnlook tree.

The svnlook tree command expects a directory as it's parameter not a regular file like you are giving it. The directory you pass to svnlook tree should have a file called format which contains the revision number of the repository this is why you get the error message above.

It is the svnlook command that is giving you the error message you are seeing. What you need to do is figure out which directory in the path /var/lib/svn/repos/ is the correct one to pass to svnlook.

You would also help yourself by reading some information on svn to better understand the system you are working with.

EDIT

There is no easy way to find all svn repositorys

You can search for all .svn directories on a system and run svn info on them then inspect the output for "Repository Root:". If you have many projects in a common repository then the output of this will need passing through uniq thus

sudo find / -name .svn  -exec dirname {} \; | \
xargs svn info | grep "Repository Root:" | uniq \
sed 's/Repository Root: file:\/\///'

You'll get something like /var/svn/repos as output.

The above lists all the repositorys for projects scattered around your filesystem. You can then

svnlook tree /var/svn/repos |grep / to find what you want for each repository listed in the output from the command above.

The only problem with the method above is that if a directory tree has been deleted and it contained an project under svn control and the project was in a unique repository then you will not find it.

1
  • realy thank you for this information ... i will read more about this subject Sep 20, 2010 at 10:07
0

You can use "-path" paramater with pattern you like

1
0

My understanding is that you want to skip the directory in your results.

You can do that with -path <path_to_skip> -prune parameters

2
  • you mean like this :- find / -type f -name fs-type -print -path <"/db/"> -prune ... if you mean this it is not work Sep 20, 2010 at 9:33
  • No, no. I use angle brackets only to indicate that path_to_skip is placeholder for real path: -path ./dir/to/skip -prune. Anyway look at Iain's answer. Sep 20, 2010 at 9:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .