{"action":"created","issue":{"url":"https://api.github.com/repos/github/backup-utils/issues/405","repository_url":"https://api.github.com/repos/github/backup-utils","labels_url":"https://api.github.com/repos/github/backup-utils/issues/405/labels{/name}","comments_url":"https://api.github.com/repos/github/backup-utils/issues/405/comments","events_url":"https://api.github.com/repos/github/backup-utils/issues/405/events","html_url":"https://github.com/github/backup-utils/issues/405","id":324230908,"number":405,"title":"Add support for storing hourly, daily, monthly backups","user":{"login":"areitz-stripe","id":23085366,"avatar_url":"https://avatars2.githubusercontent.com/u/23085366?v=4","gravatar_id":"","url":"https://api.github.com/users/areitz-stripe","html_url":"https://github.com/areitz-stripe","followers_url":"https://api.github.com/users/areitz-stripe/followers","following_url":"https://api.github.com/users/areitz-stripe/following{/other_user}","gists_url":"https://api.github.com/users/areitz-stripe/gists{/gist_id}","starred_url":"https://api.github.com/users/areitz-stripe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/areitz-stripe/subscriptions","organizations_url":"https://api.github.com/users/areitz-stripe/orgs","repos_url":"https://api.github.com/users/areitz-stripe/repos","events_url":"https://api.github.com/users/areitz-stripe/events{/privacy}","received_events_url":"https://api.github.com/users/areitz-stripe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-18T00:31:46Z","updated_at":"2018-05-18T08:35:15Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\n\r\nWe run `ghe-backup` from cron hourly on our backup server, and we keep around ~70 backups, which means that we only have ~3 days of backups on hand to do a restore. I'd prefer to keep some older backups around, and a lower granularity. I'm thinking of a scheme such as this:\r\n\r\n```\r\n$GHE_DATA_DIR/hourly\r\n$GHE_DATA_DIR/daily\r\n$GHE_DATA_DIR/monthly\r\n```\r\n\r\nThe first directory would contain 24 backups, the second one would contain 30, and the last directory would contain 12. This would let me cover easy restores for a whole year, at increasingly lower granularity. In the config, there would be corresponding variables to control the exact number of backups that would be stored at each level.\r\n\r\nIf this seems like an idea that would be accepted, I can take a look at crafting a PR. Thanks!"},"comment":{"url":"https://api.github.com/repos/github/backup-utils/issues/comments/390136612","html_url":"https://github.com/github/backup-utils/issues/405#issuecomment-390136612","issue_url":"https://api.github.com/repos/github/backup-utils/issues/405","id":390136612,"user":{"login":"lildude","id":627280,"avatar_url":"https://avatars3.githubusercontent.com/u/627280?v=4","gravatar_id":"","url":"https://api.github.com/users/lildude","html_url":"https://github.com/lildude","followers_url":"https://api.github.com/users/lildude/followers","following_url":"https://api.github.com/users/lildude/following{/other_user}","gists_url":"https://api.github.com/users/lildude/gists{/gist_id}","starred_url":"https://api.github.com/users/lildude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lildude/subscriptions","organizations_url":"https://api.github.com/users/lildude/orgs","repos_url":"https://api.github.com/users/lildude/repos","events_url":"https://api.github.com/users/lildude/events{/privacy}","received_events_url":"https://api.github.com/users/lildude/received_events","type":"User","site_admin":true},"created_at":"2018-05-18T08:35:15Z","updated_at":"2018-05-18T08:35:15Z","author_association":"MEMBER","body":"I don't think we really need this as part of Backup Utilities as this is already achievable the way things stand. It would also add potentially unneeded complexity.\r\n\r\nTo achieve what you want, you can use three different cron jobs with three different configuration files with appropriately set `GHE_DATA_DIR` and `GHE_NUM_SNAPSHOTS` options in each:\r\n\r\n```\r\nGHE_BACKUP_CONFIG=backup.config-hourly /path/to/backup-utils/bin/ghe-backup -v\r\nGHE_BACKUP_CONFIG=backup.config-daily /path/to/backup-utils/bin/ghe-backup -v\r\nGHE_BACKUP_CONFIG=backup.config-monthly /path/to/backup-utils/bin/ghe-backup -v\r\n```\r\n\r\nOr three different cron jobs with a single \"base\" configuration file (assuming default location in the following examples), and then use environment variables to override certain options specific to each cron job:\r\n\r\n```\r\nGHE_NUM_SNAPSHOTS=23 GHE_DATA_DIR=/path/to/data/hourly /path/to/backup-utils/bin/ghe-backup -v  # 23 because the 24th would be the first daily\r\nGHE_NUM_SNAPSHOTS=29 GHE_DATA_DIR=/path/to/data/daily /path/to/backup-utils/bin/ghe-backup -v # 29 because the 30th would be the first monthly\r\nGHE_NUM_SNAPSHOTS=12 GHE_DATA_DIR=/path/to/data/monthly /path/to/backup-utils/bin/ghe-backup -v\r\n```\r\n\r\nDepending on your backup host, you can either explicitly state the times etc in the crontab or add scripts to the relevant `/etc/cron.d/hourly`, `/etc/cron.d/daily` and `/etc/cron.d/monthly` directories.\r\n\r\nAn alternative solution is to use an hourly schedule and then setup another cronjob that runs a script at the desired intervals that creates a tarball (ensuring symlinks are retained) of the snapshot directory and then does something like store it in the desired daily and monthly directories or uploads it to somewhere offsite like AWS S3."}}
{"actor":{"display_login":"lildude"}}