sim n00b
Joined: 14 Sep 2002 Posts: 14
|
Posted: Fri Dec 05, 2003 5:04 pm Post subject: looking for kde+gentoo user to identify files (scrpt incld.) |
|
|
hi,
i am still trying to reanimate my system (https://forums.gentoo.org/viewtopic.php?t=111351) and identify fsck-recovered files in /lost+found. so i thought it might be a good idea to ask the kde-users in here to help me by running the following script an post their results:
the script
Code: | #!/bin/bash
# usage: searchByMd5 DIRECTORY DBFILE
# $1 -> DIR
# $2 -> DBFILE
directory=$1
dbfile=$2
echo "--- SEARCHING... ----------------------------------"
for localFile in $(find ${directory} -type f)
do
# get md5 for processed file
md5sum ${localFile} | read localMd5 localFilename
# check for matching file in db
cat ${dbfile} | while read dbMd5 dbFilename
do
if [ "$localMd5" == "$dbMd5" ]
then
echo "${dbFilename} in remote lost+found dir matches local File: ${localFilename}"
fi
done
done
echo "--- FINISHED --------------------------------------"
|
my dbfile is
Code: | #file: lost_found.md5
0fdda886bc8709f00bef4ece5f106d5c ./80207_80205
6a6f79f780313535969da903a9e81ab9 ./98586_98641
6574c258f431fa05eb9deb3458089df6 ./117814_117818
7ec64003f62f99e207fe7d00ca7ac80e ./117814_117819
b1052117829e5c11b78dd865fc796b5a ./117814_117821
5743a1773e0c05a9749ac5b633f1ca01 ./117814_117823
5d535b9727df524d4cd6b2097f270796 ./117814_117824
4615ab3f84b7407e58378997d09004a2 ./117814_117825
8b0b7f6c3d745f59604c66483693d2aa ./117814_117827
76e95dd07cc5550b6f76f0f1449145f2 ./117814_117831
21b70f6c35a7f18cf58aaf919b8710c0 ./117814_117833
1d49916c63477bdbdad631d8fd1e945c ./117814_117840
7c92cd03c613400944232b3112716799 ./117814_117842
b3bf30d70f6e94da183b7287b500130f ./117814_117844
79768da2156561aa8c0aec36be9f1939 ./117814_117846
6ff7035df64c243b76e69d02eb64e6ae ./117814_117847
7d6f69ac037e56c0626ba32bac23abaf ./117814_117848
06bf69b9ec6574c503b8f7e043d375ee ./117814_117851
80c907a53b17e3dca66fe55235d98abb ./117814_117852
f9b144eafd37792a7e7f64233039cf66 ./117814_117854
fbb3c9f5a1fde5098521a4aa5108ee68 ./117814_117855
7ef99b25febfa39e06a6ebc0d6e5b19e ./117814_117859
cc8d8e284cb668e8149da3795d19b1c4 ./117814_117860
c23509975b5192e1ae083fe6de112d29 ./117814_117861
0089ddde98d7b1d6ccf431dffb9f5c84 ./117814_117866
4597a377e73635c35814446066a1c8fb ./117814_117868
76f47b977ef62faaa1d05fec97906f99 ./117814_117870
f8f356ed4639f6f20e240aedf876e634 ./117814_117871
71eec9ecd2a369c12034194c447d70f2 ./117814_117876
3b678ef0366ebcdd077bd569eff7ddfb ./117814_117877
3d9786ef2e57e2156f13a7a6d79b4e03 ./117814_117882
c7cba7ed736119d3833b7842dd48d420 ./117814_117883
c23b102d428f92efd14ec6e62f43d36e ./117814_117885
a113f63bed1b18ad1175ea50fc8d01f1 ./117814_117888
88862ac229bc8d6a967b08f1ad084117 ./117814_117890
620eebb7d18ca1783c392536aaa30c6d ./117814_117894
b7fe982509f374a6b0066c0cf8e46e83 ./117814_117897
9c7913b67e41ea08dc8908a511581ba4 ./117814_117900
c7b13321f0d56cdb74ff95b69a27151a ./117814_117906
56a7a8e365b9958adaf44ff1211bf8c0 ./117451_117452
2663514752a8eb1ba047c11f4a0e2d7e ./117451_117503
1a8b668f49dd592fe4792619d00badb5 ./117451_117532
598b007870b8923da89d02f9552e7fcf ./7030_6931
c99af1950230d2a4a3e17f868ef2fdf3 ./90527_90536
|
it would be really helpful if someone could run this script on some system-relevant directories like /bin, /sbin etc.
example:
# ./searchByMd5 /bin ./lost_found.md5
thanks in advance
simon |
|