
Crusher is a Google Cloud BigTable maintenance utility that compacts tables by deleting old rows based on timestamp filters and key patterns.
Download the latest binary here:
https://github.com/JamesWoolfenden/crusher/releases
Install from code:
go installInstall remotely:
go install github.com/jameswoolfenden/crusher@latest
brew tap jameswoolfenden/homebrew-tap
brew install jameswoolfenden/tap/crusher
I'm now using Scoop to distribute releases, it's much quicker to update and easier to manage than previous methods, you can install scoop from https://scoop.sh/.
Add my scoop bucket:
scoop bucket add iac https://github.com/JamesWoolfenden/scoop.git
Then you can install a tool:
scoop install crusher
docker pull jameswoolfenden/crusher
docker run --tty jameswoolfenden/crusher clip --project my-project --instance my-instance --table my-table --dry-run
Note: You'll need to mount Google Cloud credentials for authentication:
docker run --tty \
-v ~/.config/gcloud:/root/.config/gcloud \
jameswoolfenden/crusher clip --project my-project --instance my-instance --table my-table
https://hub.docker.com/repository/docker/jameswoolfenden/crusher
Crusher compacts Google Cloud BigTable instances by deleting rows older than a specified number of days that match a key pattern.
Delete rows from a BigTable instance (dry-run mode by default):
crusher clip --project my-project --instance my-instance --table my-table --keyfilter ".*" --days 180 --dry-run
Required:
--project, -p: GCP project ID--instance, -i: BigTable instance ID--table, -t: BigTable table nameOptional:
--keyfilter, -k: Regex pattern to match row keys (default: ".*" - matches all rows)--days, -d: Delete rows older than this many days (default: 180)--dry-run, -r: Preview deletions without executing them (default: false)--yes, -y: Skip confirmation prompt (default: false)Preview deletions (recommended first step):
crusher clip --project my-project --instance my-instance --table my-table --dry-run
Delete old rows with confirmation prompt:
crusher clip --project my-project --instance my-instance --table my-table --days 90
This will:
Delete old chat history rows:
crusher clip --project my-project --instance my-instance --table chat-data --keyfilter ".*chat_histories$" --days 90
Delete all rows older than 1 year (skip confirmation):
crusher clip --project my-project --instance my-instance --table logs --keyfilter ".*" --days 365 --yes
Note: By default, crusher will always preview deletions and ask for confirmation unless you use --dry-run or --yes flags.
_
__ _ _ _ _ ___| |_ ___ _ _
/ _|| '_|| || |(_-<| ' \ / -_)| '_|
\__||_| \_,_|/__/|_||_|\___||_|
version: 9.9.9
NAME:
crusher - AISB utility
USAGE:
crusher [global options] command [command options]
VERSION:
9.9.9
AUTHOR:
James Woolfenden <[email protected]>
COMMANDS:
clip, c Compacts BigTable
version, v Outputs the application version
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
go build
or
Make build
Log an issue, a pr or email jim.wolf @ duck.com.
Content type
Image
Digest
sha256:7437bd68a…
Size
122.8 MB
Last updated
9 months ago
docker pull jameswoolfenden/crusher