{"id":26942407,"url":"https://github.com/krisdigital/backup-cookbook","last_synced_at":"2025-08-12T15:06:46.287Z","repository":{"id":151515075,"uuid":"163702246","full_name":"krisdigital/backup-cookbook","owner":"krisdigital","description":"Make https://supermarket.chef.io/cookbooks/backup work with backup v5","archived":false,"fork":false,"pushed_at":"2019-01-01T02:32:50.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-02T16:39:16.643Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krisdigital.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-31T23:11:02.000Z","updated_at":"2019-01-01T02:32:52.000Z","dependencies_parsed_at":"2023-05-19T00:15:31.295Z","dependency_job_id":null,"html_url":"https://github.com/krisdigital/backup-cookbook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/krisdigital/backup-cookbook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisdigital%2Fbackup-cookbook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisdigital%2Fbackup-cookbook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisdigital%2Fbackup-cookbook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisdigital%2Fbackup-cookbook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krisdigital","download_url":"https://codeload.github.com/krisdigital/backup-cookbook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisdigital%2Fbackup-cookbook/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270082327,"owners_count":24523709,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-04-02T16:49:00.315Z","updated_at":"2025-08-12T15:06:46.244Z","avatar_url":"https://github.com/krisdigital.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/cramerdev/backup-cookbook.png)](https://travis-ci.org/cramerdev/backup-cookbook)\n\n# Description\n\nUses the [Backup Ruby Gem](https://github.com/meskyanichi/backup) to perform backups.\n\n# Requirements\n\nTested on Ubuntu Linux with Ruby 1.9.3, but should run on any Unix with Ruby.\n\nRuby 1.8.7 and 1.9.2 are no longer supported.  If you require the support of\nolder Ruby versions, you should use v1.0.0 of this cookbook.  If you want to use\nv4 of the gem, you need to use this version.\n\n# Attributes\n\nSee `attributes/default.rb` for default vaules.\n\n* `node['backup']['config_path']` - Where backup configuration data will be stored. Defaults is `/etc/backup`\n* `node['backup']['log_path']` - Where backup logs will be stored. Defaults is `/var/log`\n* `node['backup']['addl_flags']` - Additional flags to pass on to the backup executable, such as `--tmp-path`\n* `node['backup']['model_path']` - Where backup models (definitions) are stored. Default is `node['backup']['config_path']/models`\n* `node['backup']['mount_options']` String or Array of [mount options](https://docs.getchef.com/resource_mount.html#attributes). (example: `[\"rw\", \"nfsvers=3\"]` would become the comma-delimited string, `rw,nfsvers=3`, passed to the `-o` argument of the `mount` command and inserted into the `\u003coptions\u003e` column of `/etc/fstab`).\n* `node['backup']['dependencies']` - An array of arrays of additional dependencies and optional versions needed for backups. The backup gem will inform you about these when the backup runs. (examples: `['fog']`, `[['fog', '1.4.0'], ['s3']]`)\n* `node['backup']['user']` - User that performs backups. Default is root\n* `node['backup']['group']` - Group that performs backups. Default is root\n* `node['backup']['version']` - Version of the Backup gem to be installed. The latest version of this cookbook should have the latest stable version of the gem\n* `node['backup']['server']` - Data about a centralized backup server. Used by the `backup_mount` resource. Default is an empty hash.\n* `node['backup']['server']['address']` - Address of the backup server.\n* `node['backup']['server']['root_path']` - Root path on the server where backups go.\n\n# Recipes\n\n## default\n\nThe default recipe installs the backup gem and its dependencies and sets up the basic configuration.\n\n# Resources and Providers\n\n## backup_model\n\nCreates a backup model with an optional `cron` schedule.\n\n### Actions\n\n* `:create` - Create a model. The default.\n* `:delete` - Delete a model\n\n### Attribute Parameters\n\n* The name attribute - A symbol used as the trigger name.\n* `description` - A description for the backup. Default is the same as the name.\n* `definition` - A string (best formed as a heredoc) defining the backup. Will be interpoleted and turned into a model file. Required.\n* `schedule` - A hash of times (minute, hour, day, month, weekday) that will be passed to a [`cron` resource](http://docs.opscode.com/chef/resources.html#cron).\n* `cron_options` - A hash of other options to be passed to the `cron` resource. Includes `:command` (will be set to the generated backup command by default), `:mailto`, `:path`, `:shell`, `:user`. Set `output_log` option to redirect output of the generated backup command  to the log file (by default this output will be ignored).\n\n### Example\n\nThis will create a model scheduled to back up a database daily:\n\n    backup_model :my_db do\n      description \"Back up my database\"\n\n      definition \u003c\u003c-DEF\n        split_into_chunks_of 4000\n\n        database MySQL do |db|\n          db.name = 'mydb'\n          db.username = 'myuser'\n          db.password = '#{node['mydb']['password']}' # will be interpolated\n        end\n\n        compress_with Gzip\n\n        store_with S3 do |s3|\n          s3.access_key_id = '#{node['aws']['access_key_id']}'\n          s3.secret_access_key = '#{node['aws']['secret_access_key']}'\n          s3.bucket = 'mybucket'\n        end\n      DEF\n\n      schedule({\n        :minute =\u003e 0,\n        :hour   =\u003e 0\n      })\n    end\n\n## backup_mount\n\nDefines an NFS mount to be used for backup storage and creates the necessary directories. Uses the `node['backup']['server']` attributes.\n\nThis fits a specific use case and may or may not be useful. It is intended to be used with the RSync::Local syncer and Local storage option.\n\n### Actions\n\n* `:enable` - Enables and mounts the device\n* `:disable` - Disables and unmounts the device\n\n### Attribute Parameters\n\n* Name attribute: The path where the mount will be placed.\n* `remote_path`: The path being accessed on the remote server\n\n### Example\n\nGiven the following attributes:\n\n* `node['backup']['server']['address'] = '192.168.0.2'`\n* `node['backup']['server']['root_path'] = 'volume1'`\n\nAnd this in the recipe:\n\n    backup_mount '/mnt/backup/myapp' do\n      remote_path '/backups/myapp' # Will be prefixed with with the `node['backup']['server']['root_path']` if it is set.\n    end\n\nwill create an NFS mount at /mnt/backup/myapp with the device 192.168.0.2:/volume1/backups/myapp.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrisdigital%2Fbackup-cookbook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrisdigital%2Fbackup-cookbook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrisdigital%2Fbackup-cookbook/lists"}