Skip to content
Bruce D'Arcus edited this page Jul 9, 2022 · 8 revisions

If you have one very large library that changes a lot, consider splitting it in two, perhaps with a script like this.

#!/bin/bash

BIG=library.bib
SMALL=new.bib

# size of small before script actually does anything
MAXSIZE=5000

# Get file size
FILESIZE=$(stat -c%s "$SMALL")

if ((FILESIZE > MAXSIZE)); then
    # when $SMALL exceeds $MAXSIZE, move its content to $BIG
    cat "$SMALL" >> "$BIG"
    echo "" > "$SMALL"
fi
Clone this wiki locally