Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/skn0tt/purgeos
Reduce cloud bill by purging old backup files from object storage π΅
https://github.com/skn0tt/purgeos
Last synced: 13 days ago
JSON representation
Reduce cloud bill by purging old backup files from object storage π΅
- Host: GitHub
- URL: https://github.com/skn0tt/purgeos
- Owner: Skn0tt
- License: mit
- Created: 2020-06-11T12:42:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:24:45.000Z (11 months ago)
- Last Synced: 2024-10-06T04:04:09.177Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 246 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
purgeOS
=======*purgeObjectStorage* | *purgeOldStuff*
Purge old backup files from object storage.
Awesome to reduce your cloud bill π΅[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/purgeos.svg)](https://npmjs.org/package/purgeos)
[![Downloads/week](https://img.shields.io/npm/dw/purgeos.svg)](https://npmjs.org/package/purgeos)
[![License](https://img.shields.io/npm/l/purgeos.svg)](https://github.com/https://github.com/skn0tt/purgeOS/blob/master/package.json)- [Getting Started](#getting-started)
- [Storage Backends](#storage-backends)
- [Google Cloud Storage](#google-cloud-storage)
- [Purging Strategies](#purging-strategies)
- [Tiered Retention](#tiered-retention)
- [Contributing](#contributing)## Getting Started
`purgeOS` can be used to thinnen your backups. At the moment, it supports GCS and a tiered retention strategy, but it's trivial to add more!
You can use either the [NPM package](https://npmjs.org/package/purgeos) or the [Docker Image](https://github.com/Skn0tt/purgeOS/packages/265067).
```sh-session
$ yarn global add purgeos
$ purgeOS \
--bucket=my-backup-bucket \
--gcs-client-email=... \
--gcs-private-key=...
``````sh-session
$ docker run \
-e BUCKET=my-backup-bucket \
-e GCS_CLIENT_EMAIL=... \
-e GCS_PRIVATE_KEY=... \
docker.pkg.github.com/skn0tt/purgeos/purgeos:latest
```I recommend setting up a cron job / scheduled container run to keep your backups tidy.
## Storage Backends
More backends can be added easily, feel free to provide a PR! :)
### Google Cloud Storage
Enable using `--backend=gcs` or `BACKEND=gcs`.
Configuration:
| Flag | Env var | Description |
|----------------------|--------------------|-------------------------------------|
| `--bucket` | `BUCKET` | The bucket to prune |
| `--gcs-client-email` | `GCS_CLIENT_EMAIL` | The client email of the IAM account |
| `--gcs-private-key` | `GCS_PRIVATE_KEY` | The private key of the IAM account |## Purging Strategies
More strategies can be added easily, feel free to provide a PR! :)
### Tiered Retention
Enable using `--strategy=tiered` or `STRATEGY=tiered`.
Will retain hourly objects for the last day,
half-daily objects for the last week,
bi-daily objects for last month,
bi-weekly objects for last year,
bi-monthly objects for everything before.## Contributing
Feel free to make this better! π
Every kind of contribution is welcome: docs, code, typo corrections, blog posts ...
If you don't know where to start, don't hesitate to reach out βΊοΈ