Skip to content

Command Line tool to automatically delete old Digital Ocean snapshots

License

Notifications You must be signed in to change notification settings

brpaz/do-snapshot-pruner

Repository files navigation

DigitalOcean snapshot pruner

Command Line tool to automatically delete old volume snapshots on DigitalOcean.

CI Status Codacy grade Code coverage Go Report Card

License Conventional Commits

Motivation

DigitalOcean doesn´t provide an automatic way to delete old snapshots. This tool provides a simple way to automate that.

Install

This recommended way is to download the latest binary for your system from the Releases page.

You can also use our Docker Image.

Usage

do-snapshot-pruner prune -t <do_token> -d <days>

Or with docker:

docker run -it brpaz/do-snapshot-pruner:latest -t <do_token> -d 5

Command Flags

Flag Description Default
-d Specifies the number of days whose older snapshots will be deleted 7 days
-t DitigalOcean API token - You can get yours here. Optionally you can also set the "DO_TOKEN" envrionment variable.
-r The types of snapshots to delete. you can filter by "volume" or "droplet all

Run tests

make test

Author

👤 Bruno Paz

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page.

Show your support

If this project have been useful for you, I would be grateful to have your support.

Give a ⭐️ to the project, or just:

Buy Me A Coffee

📝 License

Copyright © 2020 Bruno Paz.

This project is MIT licensed.