Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 ???

share|improve this question
    
Please use proper formatting in your texts. It's really hard to read otherwise. –  joschi Sep 20 '10 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 –  Mohammad AL-Rawabdeh Sep 20 '10 at 9:27

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
    
realy thank you for this information ... i will read more about this subject –  Mohammad AL-Rawabdeh Sep 20 '10 at 10:07

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

share|improve this answer
    
please you can give me an example –  Mohammad AL-Rawabdeh Sep 20 '10 at 7:01

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

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

share|improve this answer
    
you mean like this :- find / -type f -name fs-type -print -path <"/db/"> -prune ... if you mean this it is not work –  Mohammad AL-Rawabdeh Sep 20 '10 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. –  Casual Coder Sep 20 '10 at 9:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.