-
last update
- compares files
- only hardlink files which are not hardlinked yet
- permission and uid/gid must be equal
- size 0 files are excluded
- can be called with multiple arguments which are used directly by find
- writes a script which can be used to undo all hardlinks
i will not do any more updates on this and focus on the vserver unifier now (it will get a small control language and tons of more sophisticated options)
example usage:
./knoppix.unify Path/To/KNOPPIX ! -path "*/var/log/*" >undo_hardlinks.sh
File knoppix.unify:
Code:
#!/bin/bash
find "$@" -type f ! -size 0 -exec md5sum {} \; |\
sort +0 |\
{
read sum file;
while [ "$sum" != "" ]; do
while read sum2 file2 &&\
[ $sum = $sum2 ] &&\
[ $(cut -d " " -f 1 <(ls -i "$file")) != $(cut -d " " -f 1 <(ls -i "$file2")) ] &&\
[ $(cut -c -32 <(ls -ln "$file")) = $(cut -c -32 <(ls -ln "$file2")) ] &&\
cmp "$file" "$file2";
do
ln -f "$file" "$file2" &&
echo "rm -f \"$file2\"; cp -pf \"$file\" \"$file2\""
done
sum=$sum2
file="$file2"
done
}
Similar Threads
-
By fizgig in forum Customising & Remastering
Replies: 1
Last Post: 09-30-2004, 03:35 AM
-
By brazilian in forum General Support
Replies: 2
Last Post: 04-09-2004, 06:10 PM
-
By spydie in forum General Support
Replies: 14
Last Post: 01-31-2004, 07:55 PM
-
By Dave_Bechtel in forum General Support
Replies: 0
Last Post: 06-04-2003, 11:54 AM
-
By .-=Ronin=-. in forum General Support
Replies: 2
Last Post: 04-24-2003, 07:45 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules

Intel Core i7-3770K 3.5 GHz Processor
$39.00

INTEL CORE I7-870 SLBJG 2.93GHZ LGA1156 4 CORE CPU PROCESSOR
$23.00

INTEL CORE I9-10940X X-SERIES PROCESSOR | 3.30GHZ | SRGSH
$179.99

(LOT OF 20) Intel Core i5-8400 CPU 2.80GHz Desktop Processor (SR3QT)
$700.00

AMD Ryzen 5 5500 Processor ( read Description)
$59.00

Intel Core i5-12500T SRL5W 2GHz 18MB 6 Core Socket LGA1700 Desktop CPU Processor
$114.99

Intel Core i7-9700 Octa-Core 3 GHz Desktop Processor LGA 1151
$79.99

Intel i7-8700 Coffee Lake 3.2GHz 6-Core Max Turbo 4.6GHz Processor
$67.99

LAST BATCH *Brand New-Sealed* AMD Ryzen 9 9950X3D2 Dual Ed. 4.3GHz 16Core AM5
$768.00

INTEL CORE I9-10980XE PROCESSOR | 3.00GHZ | SRGSG
$299.99