Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- find ~ -size +1k -type f -print0 | \
- while read -d '' F; do
- A=$(readlink -f "$F")
- file -b "$A" | egrep -qe '^SQLite 3' || continue
- size_before=$(stat -c %s "$A")
- sqlite3 "$A" "VACUUM; REINDEX;" > /dev/null 2>&1
- size_after=$(stat -c %s "$A")
- echo -n "$F: ${size_before} -> ${size_after}, "
- echo "scale=2; (${size_after}/${size_before})*100" | bc -l
- done
- sleep 1
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement