{"id":15917465,"url":"https://github.com/takuya/ruby-lvm-snapshot-wrapper","last_synced_at":"2025-04-03T11:41:47.142Z","repository":{"id":65178265,"uuid":"585782025","full_name":"takuya/ruby-lvm-snapshot-wrapper","owner":"takuya","description":" Wrapper for lvm, to use lvm snapshot. ","archived":false,"fork":false,"pushed_at":"2023-01-31T18:47:54.000Z","size":1057,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T22:51:17.555Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takuya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-06T03:54:01.000Z","updated_at":"2023-01-06T04:01:14.000Z","dependencies_parsed_at":"2023-02-16T22:15:25.081Z","dependency_job_id":null,"html_url":"https://github.com/takuya/ruby-lvm-snapshot-wrapper","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fruby-lvm-snapshot-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fruby-lvm-snapshot-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fruby-lvm-snapshot-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takuya%2Fruby-lvm-snapshot-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takuya","download_url":"https://codeload.github.com/takuya/ruby-lvm-snapshot-wrapper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246998098,"owners_count":20866690,"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":[],"created_at":"2024-10-06T18:10:47.606Z","updated_at":"2025-04-03T11:41:47.120Z","avatar_url":"https://github.com/takuya.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Takuya::Lvm::Snapshot\n\nWrapper for lvm, to use lvm snapshot. \n## example \n\nThis package make easy to Take Snapshot and Backup.\n\n```ruby\nrequire \"takuya/lvm_snapshot\"\nLvmSnapShot = Takuya::LvmSnapShot\n\nLvmSnapShot.new('vg0').enter_snapshot('lv0'){\n    ## backup from snapshot \n    FileUtils.cp_r('/mnt/var/lib/mysql', '/nfs/backup/mysql')\n}\n```\n\nUsing proc call, We can focus on backup steps.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'takuya-lvm-snapshot'\n```\nAnd then execute:\n\n```sh\nbundle config set --local path '.bundle'\nbundle install\n```\nOr install it yourself as:\n```sh\ngem install takuya-lvm-snapshot\n```\n\n### Installation from github\nAdd Following line into Gemfile.\n```\ngem 'takuya-lvm-snapshot', git: 'https://github.com/takuya/ruby-lvm-snapshot-wrapper.git'\n```\n\n## Usage\n\ncreate / list / delete lvm snapshot\n```ruby\nrequire \"takuya/lvm_snapshot\"\nLvmSnapShot = Takuya::LvmSnapShot\n\nlvsnap = LvmSnapShot.new('vg_name')\nlvsnap.create('snap_01')\nlvsnap.exists('snap_01')\nlvsnap.mount('snap_01','/mnt')\nlvsnap.unmount('snap_01','/mnt')\nlvsnap.remove('snap_01')\n```\n\nThis package make easy to Take Snapshot and backup.\n\n```ruby\nrequire \"takuya/lvm_snapshot\"\nLvmSnapShot = Takuya::LvmSnapShot\n\nLvmSnapShot.new('vg0').enter_snapshot{|mnt|\n    ## make working snapshot.\n    ## backup from snapshot.\n    ## no stopping sevices.\n    FileUtils.cp_r('/mnt/var/lib/mysql', '/nfs/backup/mysql')\n}\n```\n\n\n#### Example.\nMake use of LVM Snap Shot allows us  to Backup without stopping services.\n\n\n```ruby\nrequire \"takuya/lvm_snapshot\"\nLvmSnapShot = Takuya::LvmSnapShot\n\nLvmSnapShot.new('vg0','lv0','20G','/mnt').enter_snapshot{|mnt|\n    ## backup from snapshot \n    src=\"#{mnt}/var/lib/libvirt/images/my-vm.qcow2\"\n    cmd=\"rsync -a '#{src}' myserver:~/my-backup \"\n    `#{cmd}`\n}\n```\n\n## Testing \n```sh\nbundle exec rspec spec \n```\n## Releasing\n```sh\nbundle exec rake release\n```\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake ` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/takuya/ruby-lvm-snapshot-wrapper/.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakuya%2Fruby-lvm-snapshot-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakuya%2Fruby-lvm-snapshot-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakuya%2Fruby-lvm-snapshot-wrapper/lists"}