{"id":20122836,"url":"https://github.com/freaky/borg-backup.sh","last_synced_at":"2025-08-27T13:22:25.600Z","repository":{"id":48086178,"uuid":"92878484","full_name":"Freaky/borg-backup.sh","owner":"Freaky","description":"A simple shell script for driving BorgBackup","archived":false,"fork":false,"pushed_at":"2022-10-26T16:38:25.000Z","size":14,"stargazers_count":22,"open_issues_count":1,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-06T16:48:57.201Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/Freaky.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":"2017-05-30T21:38:24.000Z","updated_at":"2025-04-13T01:34:34.000Z","dependencies_parsed_at":"2023-01-20T11:02:10.513Z","dependency_job_id":null,"html_url":"https://github.com/Freaky/borg-backup.sh","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Freaky/borg-backup.sh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fborg-backup.sh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fborg-backup.sh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fborg-backup.sh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fborg-backup.sh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Freaky","download_url":"https://codeload.github.com/Freaky/borg-backup.sh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Fborg-backup.sh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272335807,"owners_count":24916529,"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-27T02:00:09.397Z","response_time":76,"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":"2024-11-13T19:41:24.510Z","updated_at":"2025-08-27T13:22:25.572Z","avatar_url":"https://github.com/Freaky.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# borg-backup.sh\n\nA simple shell script for driving [Borg Backup][1].\n\n\n## Usage\n\nMake a borg-backup.conf from the provided template, e.g:\n\n    ## Read from /etc/borg-backup.conf by default.\n    ## Override by passing in CONFIG=/path/to.conf in the environment.\n    ##\n    ## This file is sourced by the shell.\n    \n    ###############################################################################\n    ## Mandatory: Target destination for backups. Directory must exist.\n    ##\n    TARGET=backup@fancy-backup-server:/backups/${HOSTNAME}\n    \n    ###############################################################################\n    ## Mandatory: A passphrase to derive an encryption key from.\n    ##\n    ## Be wary of permissions on this file.\n    ##\n    PASSPHRASE='ambiguous antelope capacitor paperclip'\n    \n    ###############################################################################\n    ## Optional: Compression\n    ##\n    ## See 'borg help compression' for available options.\n    ##\n    ## This script defaults to zstd as of 0.7.0.\n    ##\n    COMPRESSION='zstd'\n    \n    ###############################################################################\n    ## Optional: Global prune configuration\n    ##\n    PRUNE='-H 24 -d 14 -w 8 -m 6'\n    \n    ###############################################################################\n    ## Optional: Compact threshold in percent\n    ##\n    COMPACT_THRESHOLD='10'\n    \n    ###############################################################################\n    ## Mandatory: Backup name list\n    ##\n    BACKUPS='homes etc'\n    \n    ###############################################################################\n    ## Mandatory: Backup configuration.\n    ##\n    ## One per backup name. Any borg create argument other than archive name is valid.\n    ##\n    BACKUP_homes='/home/freaky -e /home/freaky/Maildir/mutt-cache'\n    BACKUP_etc='/etc /usr/local/etc'\n    \n    ###############################################################################\n    ## Optional: Per-backup prune configuration.\n    ##\n    ## These override the global configuration for individual backups.\n    #\n    PRUNE_etc='--keep-hourly=72 --keep-daily=365'\n\n\nThis will produce two independent Borg archives.  If using a remote host over SSH,\nconsider [locking down the public key][2], and using [append-only mode][3] to limit\nthe damage a compromised client can cause.\n\nInitialize repositories:\n\n    $ borg-backup.sh init\n\nAnd create your initial snapshots:\n\n    $ borg-backup.sh create\n\nAny time you want to make a new backup, re-run the create command (ideally using cron or\nother scheduler).  Borg will create a new snapshot, adding only new data.\n\nTo list archives:\n\n    $ borg-backup.sh list\n\nAnd to extract - in this case, `/etc/rc.conf` from the `etc` backup `etc-2017-02-21T20:00Z`:\n\n    $ borg-backup.sh extract etc ::etc-2017-02-21T20:00Z etc/rc.conf --stdout\n\nTo prune old backups:\n\n    $ borg-backup.sh prune\n\nTo recover space after one or more prune operations:\n\n    $ borg-backup.sh compact\n\nTo verify the repository and all archive metadata:\n\n    $ borg-backup.sh check\n\nOr the repository and the last archive:\n\n    $ borg-backup.sh quickcheck\n\nOr only the repository (a purely server-side check):\n\n    $ borg-backup.sh repocheck\n\nFor any Borg operation not covered explicitly, borg-backup.sh provides a `borg`\nsubcommand, which passes through the argument list to borg, having set up the\nenvironment for the given repository.  Refer to the [Borg documentation][4] for detailed\nusage instructions.\n\n## See Also\n\nZFS users may find [zfsnapr](https://github.com/Freaky/zfsnapr) of interest for creating\nconsistent point-in-time backups from snapshots.\n\n## Alternatives\n\nIf you want something a bit fancier, [borgmatic][5] is worth a look.\n\n\n[1]: https://borgbackup.readthedocs.io/\n[2]: https://borgbackup.readthedocs.io/en/stable/deployment.html#restrictions\n[3]: https://borgbackup.readthedocs.io/en/stable/usage.html#append-only-mode\n[4]: https://borgbackup.readthedocs.io/en/stable/usage.html\n[5]: https://github.com/witten/borgmatic\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreaky%2Fborg-backup.sh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreaky%2Fborg-backup.sh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreaky%2Fborg-backup.sh/lists"}