Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mconf/digital-ocean-snapshots
Simple automated snapshots on DigitalOcean
https://github.com/mconf/digital-ocean-snapshots
Last synced: 20 days ago
JSON representation
Simple automated snapshots on DigitalOcean
- Host: GitHub
- URL: https://github.com/mconf/digital-ocean-snapshots
- Owner: mconf
- Created: 2021-02-08T19:18:08.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-02-01T19:10:06.000Z (almost 2 years ago)
- Last Synced: 2024-04-12T16:08:42.406Z (9 months ago)
- Language: Ruby
- Size: 17.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Digital Ocean Snapshots
A simple way to automate snapshots for droplets and volumes on DigitalOcean.
## How it works
* Add your API key to the script (set it on `API_TOKEN`).
* Set the script to run on cron daily (or weekly, or wherever you want).
* Add the `snap` tag (or choose another tag setting `TAG`) on the droplets and volumes you want to snapshot.
* The script will run, create the new snapshots and rotate (remove old snapshots). It will keep `NUM_SNAPSHOTS` snapshots of each droplet and volume.## Running
```
DRYRUN=true TAG=snap NUM_SNAPSHOTS=5 API_TOKEN=adigitaloceansecrettoken ruby do-snap.rb
```## Running on cron
```
# run once a day at 4AM UTC
0 4 * * * docker run -d --name snap -e API_TOKEN=XXX mconf/digital-ocean-snapshots:latest
```## Development
### Running on docker
```
docker build . -t mconf/digital-ocean-snapshots:latest
docker run -ti --rm --name snap -e API_TOKEN=XXX mconf/digital-ocean-snapshots:latest
```### Generating a new version
Just create and push a tag and dockerhub will build a new image.