{"id":20222915,"url":"https://github.com/twi1ightsparkle/borg-wrapper","last_synced_at":"2025-09-07T18:47:11.157Z","repository":{"id":64922176,"uuid":"568578313","full_name":"Twi1ightSparkle/borg-wrapper","owner":"Twi1ightSparkle","description":"An (almost) no-dependency wrapper script for basic Borg backup features.","archived":false,"fork":false,"pushed_at":"2025-07-20T08:34:47.000Z","size":144,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-20T10:22:02.871Z","etag":null,"topics":["backup","borg"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Twi1ightSparkle.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-11-21T00:07:24.000Z","updated_at":"2025-07-20T08:31:54.000Z","dependencies_parsed_at":"2025-01-13T23:12:31.411Z","dependency_job_id":"7a849fad-c2d7-4623-ab19-517500ad587b","html_url":"https://github.com/Twi1ightSparkle/borg-wrapper","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Twi1ightSparkle/borg-wrapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Twi1ightSparkle%2Fborg-wrapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Twi1ightSparkle%2Fborg-wrapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Twi1ightSparkle%2Fborg-wrapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Twi1ightSparkle%2Fborg-wrapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Twi1ightSparkle","download_url":"https://codeload.github.com/Twi1ightSparkle/borg-wrapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Twi1ightSparkle%2Fborg-wrapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274080610,"owners_count":25219018,"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-09-07T02:00:09.463Z","response_time":67,"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":["backup","borg"],"created_at":"2024-11-14T06:58:11.086Z","updated_at":"2025-09-07T18:47:11.114Z","avatar_url":"https://github.com/Twi1ightSparkle.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Borg wrapper\n\n\u003c!--\nBorg wrapper. An (almost) no-dependency wrapper script for basic Borg backup features.\nCopyright (C) 2022  Twilight Sparkle\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published\nby the Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n--\u003e\n\nI don't recommend relying on this script in production yet. Or, at least, frequently review and verify your backups.\n\n\u003chttps://www.borgbackup.org/\u003e\n\nBorg documentation: \u003chttps://borgbackup.readthedocs.io/en/stable/\u003e\n\n## Setup\n\n- Download and extract the latest [release](https://github.com/Twi1ightSparkle/borg-wrapper/releases)\n- Copy the `sample.config` directory to `config`\n- Edit `config/borg.env` and add your config options\n- Add a secure passphrase to the first line of the `borg_passphrase` file\n- Edit `exclude.txt` and `include.txt` with your requirements. One entry per line\n- From the root of the repo, run `./borg-wrapper.sh --init` to initialize the repo\n- **IMPORTANT: Back up your passphrase and the keyfile generated by Borg. Without these two, you will not be able to\naccess your backups**\n- Use crontab (or the scheduler of your choice) to run `./borg-wrapper.sh --backup --automated --live` periodically.\nSee `crontab_example` for an example configuration\n- If you need to run multiple profiles, you can use the `--config` option to specify a different config directory\n\nSee [src/help.sh](https://github.com/Twi1ightSparkle/borg/blob/main/src/help.sh) for all command line options.\n\n## env file\n\nComment out or remove an option to use its default.\n\n### Required options\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eOption\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eTARGET_DIRECTORY\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\n            \u003cul\u003e\n                \u003cli\u003eFull path to the backup target directory\u003c/li\u003e\n                \u003cli\u003eLocal or remote\u003c/li\u003e\n                \u003cli\u003eThe directory must be empty\u003c/li\u003e\n                \u003cli\u003eDirectory will be created if it does not exist\u003c/li\u003e\n                \u003cli\u003eThe parent directory must exist\u003c/li\u003e\n            \u003c/ul\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n### Required when `REMOTE=true`\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eOption\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eREMOTE_DOMAIN\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eFQDN or IP of the Borg backup server/target\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eREMOTE_SSH_PRIVKEY\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\n            Full path to the private SSH key used to log in to \u003ccode\u003eREMOTE_DOMAIN\u003c/code\u003e. Cannot be password protected\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eREMOTE_USER\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eUsername to log in to \u003ccode\u003eREMOTE_DOMAIN\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n### Required when `WEBHOOK_ENABLED=true`\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eOption\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eWEBHOOK_URL\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eYour webhook URL\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n### Optional options\n\nThese options are optional. If not set, the default will be used.\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eOption\u003c/th\u003e\n        \u003cth\u003eDefault\u003c/th\u003e\n        \u003cth\u003eDescription\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eBACKUP_PASSPHRASE_FILE\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003econfigDirectory/ borg_passphrase\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eFull path to the file containing the passphrase. **Make sure you protect and back up this file**\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eBACKUP_PREFIX\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003ehostname-\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eBackup name prefix\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eCOMPACT_ON_BACKUP\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003etrue\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eRun compact after every backup\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eEXCLUDE_FILE\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003econfigDirectory/ exclude.txt\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eFull path to the file with a list of paths to exclude in the backup\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eINCLUDE_FILE\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003econfigDirectory/ include.txt\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eFull path to the file with a list of paths to include in the backup\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eKEEP_DAILY\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e7\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eKeep this many daily backups\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eKEEP_HOURLY\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e2\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eKeep this many hourly backups\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eKEEP_MONTHLY\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e12\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eKeep this many monthly backups\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eKEEP_WEEKLY\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e4\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eKeep this many weekly backups\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eKEEP_WITHIN\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e24H\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eKeep all backups in this period\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eKEEP_YEARLY\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e-1\u003c/code\u003e (infinitely)\u003c/td\u003e\n        \u003ctd\u003eKeep this many yearly backups\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eKEYFILE\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003econfigDirectory/ keyfile\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\n            Full path to the keyfile to encrypt backups with. The file cannot exist; Borg generates it.\n            **Make sure you protect and back up this file**\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eKEYFILE_IN_REPO\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003efalse\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\n            Store the backup keyfile unencrypted in the backup repo\n        \u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eLOG_FILE\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003econfigDirectory/ borg.log\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eFull path to the script log file\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eONE_FILE_SYSTEM\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003etrue\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eSet to true to exclude mounted file systems from backup\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003ePRUNE_ON_BACKUP\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003etrue\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eRun prune after every backup\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eREMOTE_PORT\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003e22\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003ePort to connect to \u003ccode\u003eREMOTE_DOMAIN\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eREMOTE\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003efalse\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eBack up to a remote target over SSH\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eWEBHOOK_ENABLED\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003efalse\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003eEnable logging to webhook\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003ccode\u003eWEBHOOK_VERBOSE\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003ccode\u003etrue\u003c/code\u003e\u003c/td\u003e\n        \u003ctd\u003e\n            More verbose webhook logging. Set to false to only send a single message at the end of a successful\n            operation. Only affects \u003ccode\u003e--backup\u003c/code\u003e and \u003ccode\u003e--init\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n## Webhook logging\n\nThis is developed for use with [Matrix-Hookshot](https://github.com/matrix-org/matrix-hookshot) generic webhooks. Add\nthe Transformation JavaScript from `hookshot_webhook_js_transformation.js` to enable @room mentions for errors. Make\nsure you give the webhook appservice user permissions to @room. However, this should work with any webhook reader that\naccepts unauthenticated `PUT` JSON requests with the key `text`. To edit the behavior, edit the `webhook` function in\n`src/utils.js` to fit your needs.\n\n## Mac\n\nOn Mac, you must give `cron` full disk access.\n\n- In the terminal, enter `open /usr/sbin`\n- Go to `System Settings` -\u003e `Privacy \u0026 Security` -\u003e `Full Disk Access`\n- From Finder, drag `cron` into the `Full Disk Access` window\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwi1ightsparkle%2Fborg-wrapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwi1ightsparkle%2Fborg-wrapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwi1ightsparkle%2Fborg-wrapper/lists"}