You are not logged in.
Hi,
Good news: Im back :-)
Hm, seems nobody recognized I was gone for a while... ;-)
OK, here is my "problem":
Im searching for a tool which can compare folderstructures. Reason: I want to chroot some services (Apache etc) but dont want to check for each dependency. So I want to compare the situation before and after a normal installation to check which files have to be symlinked or copied to the chroot folder.
Any hints how to solve this problem?
Offline
You could just check out the contents of the package and the packages install file (if any) to see what files get created, modified, etc.
Another way would be using rsync with the --dry-run option.
Offline
I am looking for a unix-wide solution, not arch specific. I should have mentioned this.
I will check out rsync. What tools do you use for chrooting?
Offline
You can use diff to compare two different directories:
# diff -rq <dir1> <dir2>
Dunno if thats something that could be used in your case.
Or can't you just use find or something to dump the file structure to a file before and after the installation and then just diffing the files?
Last edited by mr_echo (2007-02-25 11:23:50)
Offline
Or can't you just use find or something to dump the file structure to a file before and after the installation and then just diffing the files?
hmmmm....what about
find . -name "*" > structure.[before/after]
Offline
This returns a list of files with all the information:
find -exec ls -l {} \;|sed 's/^total [0-9]*$//g'
I don't know how to avoid the blank lines.
run this before,
find -exec ls -l {} \;|sed 's/^total [0-9]*$//g' > files_before
run this after,
find -exec ls -l {} \;|sed 's/^total [0-9]*$//g' > files_after
run diff
diff files_before files_after
This may be a start point for a bash script.
Offline
Wow, cool ideas. Thanks a lot.
I guess I will make a script out of ur samples. I totally forgot the POWER OF SHELLS ;-)
You found what I needed! Great.
Offline
meld knows how to cmp directories... but's it's gui tool
Offline
I need it for server usage. No graphics on servers ;-)
Offline
This returns a list of files with all the information:
find -exec ls -l {} \;|sed 's/^total [0-9]*$//g'
I don't know how to avoid the blank lines.
sed '/^$/d'
Offline
thanks sincity,
so the line ends up like this:
find -exec ls -l {} \;|sed 's/^total [0-9]*$//g'|sed '/^$/d'
Offline