{"id":21182838,"url":"https://github.com/merqlove/do_snapshot","last_synced_at":"2025-04-10T01:15:55.957Z","repository":{"id":18711934,"uuid":"21922661","full_name":"merqlove/do_snapshot","owner":"merqlove","description":"A command-line snapshot maker for your DigitalOcean droplets. Fully Automated. Multi-threaded.","archived":false,"fork":false,"pushed_at":"2020-12-05T16:59:50.000Z","size":563,"stargazers_count":85,"open_issues_count":2,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-10T01:15:47.883Z","etag":null,"topics":["backup","cron","digitalocean","droplet","homebrew","ruby","safety","snapshot","standalone"],"latest_commit_sha":null,"homepage":"http://dosnapshot.merqlove.ru","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/merqlove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-17T00:10:48.000Z","updated_at":"2024-11-25T17:16:30.000Z","dependencies_parsed_at":"2022-09-13T11:01:29.383Z","dependency_job_id":null,"html_url":"https://github.com/merqlove/do_snapshot","commit_stats":null,"previous_names":[],"tags_count":40,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merqlove%2Fdo_snapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merqlove%2Fdo_snapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merqlove%2Fdo_snapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/merqlove%2Fdo_snapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/merqlove","download_url":"https://codeload.github.com/merqlove/do_snapshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137891,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","cron","digitalocean","droplet","homebrew","ruby","safety","snapshot","standalone"],"created_at":"2024-11-20T17:58:14.647Z","updated_at":"2025-04-10T01:15:55.923Z","avatar_url":"https://github.com/merqlove.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DoSnapshot CLI \n\n[![Join the chat at https://gitter.im/merqlove/do_snapshot](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/merqlove/do_snapshot?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[Project Page at Digital Ocean](https://www.digitalocean.com/community/projects/dosnapshot), comment or vote for this project.\n\n[![Gem Version](https://badge.fury.io/rb/do_snapshot.svg)](http://badge.fury.io/rb/do_snapshot)\n[![Build Status](https://travis-ci.org/merqlove/do_snapshot.svg?branch=master)](https://travis-ci.org/merqlove/do_snapshot)\n[![Dependency Status](https://gemnasium.com/merqlove/do_snapshot.svg)](https://gemnasium.com/merqlove/do_snapshot)\n[![Coverage Status](https://coveralls.io/repos/merqlove/do_snapshot/badge.png?branch=master)](https://coveralls.io/r/merqlove/do_snapshot?branch=master)\n[![Inline docs](http://inch-ci.org/github/merqlove/do_snapshot.png?branch=master)](http://inch-ci.org/github/merqlove/do_snapshot)\n[![Code Climate](https://codeclimate.com/github/merqlove/do_snapshot.png)](https://codeclimate.com/github/merqlove/do_snapshot)\n\nUse this tool to backup DigitalOcean droplet's via snapshot method, on the fly!\n\n\u003c!--### Looking for a fully managed DigitalOcean backups solution? [We recommend Weap.io which has support for Droplets and Volumes](https://weap.io/)  --\u003e\n\n## API Changes: \n- 20.08.17: Change `Barge` to `DropletKit`. Release `1.0.0`.   \n- 03.08.16: DO now automagically keeps our droplets running when snapshot is processing, so:  \n  Added options `--shutdown`, `--no-shutdown`.    \n  `shutdown` now disabled by default, no downtime anymore, `YES`!  \n  If you want `shutdown` back use `--shutdown` option.\n- 08.01.16: now we have to use DO API V2 only, because V1 is not work anymore.\n- 17.10.15: now we use DO API V2 by default, due V1 deprecation at 11.2015.\n\nHere are some features:\n\n- Multiple threads out of the box, no matter how many droplets you have.\n- Snapshots Auto-Cleanup.\n- Auto-Boot Droplet if Snapshot Event fails or encounters a bad connection exception.\n- Special binaries for cron and command-line, Homebrew, and standalone installers.\n- Mail notifications when a snapshot fails or the maximum number of snapshots is reached for a droplet or droplets.\n- Custom mail settings (You can set [Pony](https://github.com/benprew/pony) mail settings).\n- Stop mode (automatically stop creating new snapshots when the maximum is reached).\n- Timeout option for long requests or uncaught loops. Defaults to 600 seconds, but can be changed.\n- Logging into selected directory.\n- Verbose mode for research.\n- Quiet mode for silence.\n\n## Compatibility\n\nFrom `1.0.0`:\n- Ruby version 2.0.0 or higher\n- JRuby 9.1.0.0 or higher\n\nPrior to `0.6.4`:\n- Ruby version 1.9.3 or higher\n- JRuby 1.7, 9.0.0.0 or higher\n\n\u003cimg src=\"https://raw.githubusercontent.com/merqlove/do_snapshot/master/assets/example.png\" style=\"max-width:100%\" alt=\"DoSnaphot example\"\u003e\n\n## Installation\n\nInstall it yourself as:\n\n    $ gem install do_snapshot\n    \nSystem Wide Install (OSX, *nix):\n  \n    $ sudo gem install do_snapshot\n        \nFor **OSX** users ([Homebrew Tap](http://github.com/merqlove/homebrew-do-snapshot)):\n\n    $ brew tap merqlove/do-snapshot \u0026\u0026 brew install do_snapshot\n    \n    $ do_snapshot -V\n\nStandalone with one-liner:\n\n    $ wget https://s3.amazonaws.com/assets.merqlove.ru/do_snapshot/do_snapshot.tgz \u0026\u0026 sudo tar -xzf do_snapshot.tgz /usr/local/lib/ \u0026\u0026 sudo ln -s /usr/local/lib/do_snapshot/bin/do_snapshot /usr/local/bin/do_snapshot\n\nStandalone pack for **Unix/Linux** users: [Download](https://s3.amazonaws.com/assets.merqlove.ru/do_snapshot/do_snapshot.tgz)\n \n    $ wget https://s3.amazonaws.com/assets.merqlove.ru/do_snapshot/do_snapshot.tgz # if not done.\n    \n    # Example Install into /usr/local\n    \n    $ tar -xzf do_snapshot.tgz /usr/local/ \u0026\u0026 ln -s /usr/local/do_snapshot/bin/do_snapshot /usr/local/bin/do_snapshot \n    $ do_snapshot help      \n\nStandalone Zip pack for others: [Download](https://s3.amazonaws.com/assets.merqlove.ru/do_snapshot/do_snapshot.zip)\n    \n## Usage\n\nMainly it's pretty simple:\n\n    $ do_snapshot --only 123456 -k 5 -c -v\n\n### Setup \n\n### Digitalocean API V2 (default):\nYou'll need to generate an access token in Digital Ocean's control panel at https://cloud.digitalocean.com/settings/applications\n    \n    $ export DIGITAL_OCEAN_ACCESS_TOKEN=\"SOMETOKEN\"\n    \nIf you want to set keys without environment, than set it via options when you run do_snapshot:\n    \n    $ do_snapshot --digital-ocean-access-token YOURLONGTOKEN   \n\n### How-To \n\n##### Tutorials: \n- [Automate Taking Snapshots of Your DigitalOcean Droplets with DOSnapshot\n, Tyler Longren](https://longren.io/automate-making-snapshots-of-your-digitalocean-droplets/)\n- [How to Automate Taking Digital Ocean Droplet Snaphot with DoSnapShot Script, Arun Kumar](http://www.ashout.com/automate-digital-ocean-droplet-snaphot/)\n\nHere we `keeping` only 5 **latest** snapshots and cleanup older after new one is created. If creation of snapshots failed no one will be deleted. By default we keeping `10` droplets.\n\n    $ do_snapshot --keep 5 -c\n    \nKeep latest 3 from selected droplet:\n  \n    $ do_snapshot --only 123456 --keep 3\n  \nWorking with all except droplets:\n  \n    $ do_snapshot --exclude 123456 123457\n  \nKeep latest 5 snapshots, send mail notification instead of creating new one:\n  \n    $ do_snapshot --keep 10 --stop --mail to:yourmail@example.com\n    \n\u003cimg src=\"https://raw.githubusercontent.com/merqlove/do_snapshot/master/assets/safe_mode.png\" style=\"max-width:100%\" alt=\"DoSnapshot Safe Mode Example\"\u003e\n    \nE-mail notifications disabled out of the box. \nFor working mailer you need to set e-mail settings via run options.\n\n    --mail to:mail@somehost.com from:from@host.com --smtp address:smtp.gmail.com port:25 user_name:someuser password:somepassword\n\n### Cron example\n\n    0 4 * * 7 . /.../.digitalocean_keys \u0026\u0026 /.../bin/do_snapshot -k 5 -m to:TO from:FROM -t address:HOST user_name:LOGIN password:PASSWORD port:2525 -q -c\n\n### Real world example\n\n    $ bin/do_snapshot --only 123456 -k 3 -c -m to:TO from:FROM -t address:HOST user_name:LOGIN password:PASSWORD port:2525 -v\n    \n    Checking DigitalOcean Id's.\n    Start performing operations\n    Setting DigitalOcean Id's.\n    Loading list of DigitalOcean droplets\n    Working with list of DigitalOcean droplets\n    Preparing droplet id: 123456 name: mrcr.ru to take snapshot.\n    Shutting down droplet.\n    Start creating snapshot for droplet id: 123456 name: mrcr.ru.\n    Wait until snapshot will be created.\n    Snapshot name: mrcr.ru_2014_07_18 created successfully.\n    Droplet id: 123456 name: mrcr.ru snapshots: 4.\n    For droplet with id: 123456 and name: mrcr.ru the maximum number 3 of snapshots is reached.\n    Cleaning up snapshots for droplet id: 123456 name: mrcr.ru.\n    Snapshot name: mrcr.ru_2014_07_17 delete requested.\n    All operations has been finished.\n    Sending e-mail notification.\n\n### All options:    \n\n    \u003e $ do_snapshot c  \n    \n    aliases: s, snap, create\n    \n    Options:\n      -p, [--protocol=1]                                             # Select api version.\n                                                                     # Default: 2\n          [--shutdown], [--no-shutdown]                              # Check if you want to stop your droplet before the snapshot.\n      -o, [--only=123456 123456 123456]                              # Select some droplets.\n      -e, [--exclude=123456 123456 123456]                           # Except some droplets.\n      -k, [--keep=5]                                                 # How much snapshots you want to keep?\n                                                                     # Default: 10\n      -d, [--delay=5]                                                # Delay between snapshot operation status requests.\n                                                                     # Default: 10                                                                    \n          [--timeout=250]                                            # Timeout in sec's for events like Power Off or Create Snapshot.\n                                                                     # Default: 3600                                                                     \n      -m, [--mail=to:yourmail@example.com]                           # Receive mail if fail or maximum is reached.\n      -t, [--smtp=user_name:yourmail@example.com password:password]  # SMTP options.\n      -l, [--log=/Users/someone/.do_snapshot/main.log]               # Log file path. By default logging is disabled.\n      -c, [--clean], [--no-clean]                                    # Cleanup snapshots after create. If you have more images than you want to `keep`, older will be deleted.\n      -s, [--stop], [--no-stop]                                      # Stop creating snapshots if maximum is reached.\n          [--stop-by-power], [--no-stop-by-power]                    # Droplet stop method, by it's power status (instead of waiting for event completed state).\n      -v, [--trace], [--no-trace]                                    # Verbose mode.\n      -q, [--quiet], [--no-quiet]                                    # Quiet mode. If don't need any messages in console.\n          [--digital-ocean-access-token=YOURLONGAPITOKEN]            # DIGITAL_OCEAN_ACCESS_TOKEN. if you can't use environment.\n          [--digital-ocean-client-id=YOURLONGAPICLIENTID]            # DIGITAL_OCEAN_CLIENT_ID. if you can't use environment.\n          [--digital-ocean-api-key=YOURLONGAPIKEY]                   # DIGITAL_OCEAN_API_KEY. if you can't use environment.    \n    \n    Description:\n      `do_snapshot` able to create and cleanup snapshots on your droplets.\n    \n      You can optionally specify parameters to select or exclude some droplets.   \n\n## You can ask, \"Why you made this tool?\"\n\n- First. I needed stable tool, which can provide for me automatic Snapshot feature for all of my Droplets via Cron planner.\n- I don't want to think how much snapshots for each droplet i have.\n- I don't wont to sleep when my droplets Offline!!! And i wanted tool which can BOOT back droplets, which failed to snapshot.\n- Also i want to understand what's going on if there some error. Mail is my choice. But logs also good.\n- And ... sure ;) We want to do it fast as rocket! :)\n- more more more...\n- So this tool can save a lot of time for people.\n\n## Donating:\nSupport this project and others by [merqlove](https://gratipay.com/~merqlove/) via [gratipay](https://gratipay.com/~merqlove/).  \n[![Support via Gratipay](https://cdn.rawgit.com/gratipay/gratipay-badge/2.3.0/dist/gratipay.png)](https://gratipay.com/merqlove/)\n\n## Dependencies:\n\n- [Thor](https://github.com/erikhuda/thor) for CLI.\n- [DropletKit](https://github.com/digitalocean/droplet_kit) for API V2 requests.\n- [Pony](https://github.com/benprew/pony) for mail notifications.\n\n## Contributing\n\n1. Fork it ( https://github.com/merqlove/do_snapshot/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n### Testing\n\n    $ rake spec \n\nCopyright (c) 2015 Alexander Merkulov\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmerqlove%2Fdo_snapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmerqlove%2Fdo_snapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmerqlove%2Fdo_snapshot/lists"}