mirror of
https://github.com/Zygo/bees.git
synced 2025-05-18 05:45:45 +02:00
Make filters configurable
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
parent
badfa6e9b9
commit
22e601912e
31
scripts/beesd
Normal file → Executable file
31
scripts/beesd
Normal file → Executable file
@ -50,6 +50,7 @@ BEESHOME="${BEESHOME:-$MNT_DIR/.beeshome}"
|
|||||||
BEESSTATUS="${BEESSTATUS:-$WORK_DIR/$UUID.status}"
|
BEESSTATUS="${BEESSTATUS:-$WORK_DIR/$UUID.status}"
|
||||||
DB_SIZE="${DB_SIZE:-$((64*AL16M))}"
|
DB_SIZE="${DB_SIZE:-$((64*AL16M))}"
|
||||||
LOG_SHORT_PATH="${LOG_SHORT_PATH:-N}"
|
LOG_SHORT_PATH="${LOG_SHORT_PATH:-N}"
|
||||||
|
LOG_FILTER_TIME="${LOG_FILTER_TIME:-N}"
|
||||||
|
|
||||||
INFO "Check: BTRFS UUID exists"
|
INFO "Check: BTRFS UUID exists"
|
||||||
if [ ! -d "/sys/fs/btrfs/$UUID" ]; then
|
if [ ! -d "/sys/fs/btrfs/$UUID" ]; then
|
||||||
@ -97,15 +98,29 @@ fi
|
|||||||
chmod 700 "$DB_PATH"
|
chmod 700 "$DB_PATH"
|
||||||
}
|
}
|
||||||
|
|
||||||
filter_output(){
|
MNT_DIR="${MNT_DIR//\/\//\/}"
|
||||||
sed -e 's/^.*crawl:/crawl:/g' \
|
|
||||||
-e 's/^.*status:/status:/g' \
|
filter_time(){
|
||||||
-e 's/^.*bees:/bees:/g' \
|
if YN $LOG_FILTER_TIME; then
|
||||||
-e 's/^.*crawl_writeback:/crawl_writeback:/g' \
|
sed -e 's/^.*crawl:/crawl:/g' \
|
||||||
-e 's/^.*main:/main:/g' \
|
-e 's/^.*status:/status:/g' \
|
||||||
-e 's/^.*hash_prefetch:/hash_prefetch:/g'
|
-e 's/^.*bees:/bees:/g' \
|
||||||
|
-e 's/^.*crawl_writeback:/crawl_writeback:/g' \
|
||||||
|
-e 's/^.*main:/main:/g' \
|
||||||
|
-e 's/^.*hash_prefetch:/hash_prefetch:/g'
|
||||||
|
else
|
||||||
|
cat
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
bees "$MNT_DIR" 3>&1 2>&1 | filter_output
|
filter_path(){
|
||||||
|
if YN $LOG_SHORT_PATH; then
|
||||||
|
sed -e "s#$MNT_DIR##g"
|
||||||
|
else
|
||||||
|
cat
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
bees "$MNT_DIR" 3>&1 2>&1 | filter_time | filter_path
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -12,6 +12,12 @@ UUID=5d3c0ad5-bedf-463d-8235-b4d4f6f99476
|
|||||||
# BEESHOME="$MNT_DIR/.beeshome"
|
# BEESHOME="$MNT_DIR/.beeshome"
|
||||||
# BEESSTATUS="$WORK_DIR/$UUID.status"
|
# BEESSTATUS="$WORK_DIR/$UUID.status"
|
||||||
|
|
||||||
|
## Make path shorter in logs
|
||||||
|
# LOG_SHORT_PATH=N
|
||||||
|
|
||||||
|
## Remove timestamp from bees output
|
||||||
|
# LOG_FILTER_TIME=N
|
||||||
|
|
||||||
## Bees DB size
|
## Bees DB size
|
||||||
# Hash Table Sizing
|
# Hash Table Sizing
|
||||||
# sHash table entries are 16 bytes each
|
# sHash table entries are 16 bytes each
|
||||||
|
Loading…
x
Reference in New Issue
Block a user