This might be at times complicated or confusing; remember: I coded the lsfind suite for myself and therefore never worked on anything like user friendliness.
So this time it's more of a "coding badly"
luh is short for "Look for external Usb thumb-drives and external Hard-disks"
It is an alias for two other aliases:
Code: Select all
root@porteus:/Lsfind# type luh
luh is aliased to `lu;lh'
root@porteus:/Lsfind# type lu
lu is aliased to `locate_extUSB.sh |/bin/grep --color=never " device[s ][ i][as]"'
root@porteus:/Lsfind# type lh
lh is aliased to `locate_extHD.sh |/bin/grep --color=never " device[s ][ i][as]"'
Code: Select all
root@porteus:/Lsfind# luh
extHD is extHD8 - devices are /mnt/sdb1 /mnt/sdb2 /mnt/sdb3 /mnt/sdb4
Therefore it must be done manually, and I let the script "lsfind-extXYZ.sh " explain what it needs.
lsfind sits in /usr/local/bin, as well as its "helper" scripts that are uses to determine how many partitions the known internal or external hard-disks or thumb-drives have.
The scripts themselves that create the data (*ls.zg and *find.gz) all sit in my ext2 container mounted in /Lsfind - since I do want that database in one definite place (better to share the most recent databases abong my PC systems)
The script for the internal lsfind is only valid for the intHDD that is the one the PC itself has.
In case of my current system - intHDD1 - it is made like so:
Code: Select all
root@porteus:/Lsfind# l lsfind-int*
-rwxr-xr-x 1 root 5778 2021-02-17 08:10 lsfind-intHDD.sh
-rw-r--r-- 1 root 5778 2021-02-17 08:10 lsfind-intHDD.shBAK
root@porteus:/Lsfind# l .lsfind-intHD*sh
-rwxr-xr-x 1 root 5052 2018-02-24 05:18 .lsfind-intHDC1.sh
Now for the rest: manually executing lsfind via the helper script ./lsfind-extXYZ.sh
Code: Select all
root@porteus:/Lsfind# l /mnt/sdc1/extUSBXX*
-rwxrwxrwx 1 guest 0 2022-02-11 10:40 /mnt/sdc1/extUSBXX
-rwxrwxrwx 1 guest 0 2016-12-26 10:32 /mnt/sdc1/extUSBXX_Hama_Blau_08GB
root@porteus:/Lsfind# ./lsfind-extXYZ.sh
lsfind-extXYZ.sh V0.8
Error: 2 parameters needed:
$1 the valid mount folder of the extXYZ drive, e.g. /mnt/sdc1
$2 the name of the extXYZ drive, e.g. extUSBXZ, extUSBXX2, etc.
Cave! For now there is no sanity check!
(check which drive it is with alias "extHD+USB") or with this ls instead:
ls --color=auto /mnt/sd[a-z][1-9]/ext[HU][DS]* /mnt/sd[a-z]/ext[HU][DS]* 2>/dev/null
If you need to add a 2nd partition do it like so after running this script
(assuming you have USBXX1 mounted on /mnt/sdb1 & /mnt/sdb2):
df -mT /mnt/sdb2/ |/bin/grep sdb2 >>extUSBXX1.df
lsfind /mnt/sdb2 extUSBXX1_2
root@porteus:/Lsfind# ./lsfind-extXYZ.sh /mnt/sdc1 extUSBXX
lsfind-extXYZ.sh V0.8
Target folder given is: /mnt/sdc1 - extUSB Name given is: extUSBXX
/mnt/sdc1/extUSBXX
/mnt/sdc1/extUSBXX_Hama_Blau_08GB
Sleeping 3 seconds. Abort now with Ctrl+C !
starting lsfind: mountpath: /mnt/sdc1 - drive name: extUSBXX
schreibe... /tmp/4893/extUSBXX.ls
schreibe... /tmp/4893/extUSBXX.find
gzip -f /tmp/4893/extUSBXX.ls
gzip -f /tmp/4893/extUSBXX.find
writing extUSBXX.df: will only look for one partition: /mnt/sdc1
If you need to add a 2nd partition do it like so after running this script:
(assuming you have USBXX1 mounted on /mnt/sdb1 & /mnt/sdb2):
df -mT /mnt/sdb2/ |/bin/grep sdb2 >>extUSBXX1.df
lsfind /mnt/sdb2 extUSBXX1_2
Code: Select all
root@porteus:/Lsfind# lsfind
no given directory or given directory not found- aborting!
Code: Select all
lsfind /mnt/sdb2 extUSBXX1_2
extUSBXX1_2 -> appropriate name for the extUSBXX1_2.ls.gz and extUSBXX1_2.find.gz database files.
The scripts giving the info to lsfind - or when the user runs lsfind by itself have to make sure all info given to lsfind is correct, lsfind is stupid in itself and just does the ls and the find where it got told the mount point is and gives the databases the names it got told to use.
When the mount point is incorrect or you choose a wrong name for the database then confusion can occur.
E.g. when you let lsfind write into intHDA1* database files when instead the correct name would have been extHD1*.
Searching later for files would give you the results in "intHDA1_1" - but when you look there, the consent would be different, since the drive was instead the external one "extHD1_1".