{"id":36987606,"url":"https://github.com/olafnorge/borgphp","last_synced_at":"2026-01-13T23:08:57.010Z","repository":{"id":38679896,"uuid":"268030226","full_name":"olafnorge/borgphp","owner":"olafnorge","description":"PHP command wrapper for borgbackup.","archived":false,"fork":false,"pushed_at":"2021-03-21T12:28:13.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-11T01:29:16.241Z","etag":null,"topics":["backup","borg","borgbackup","library"],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/olafnorge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-30T07:24:29.000Z","updated_at":"2023-05-24T14:23:14.000Z","dependencies_parsed_at":"2022-08-24T23:50:27.754Z","dependency_job_id":null,"html_url":"https://github.com/olafnorge/borgphp","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/olafnorge/borgphp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olafnorge%2Fborgphp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olafnorge%2Fborgphp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olafnorge%2Fborgphp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olafnorge%2Fborgphp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olafnorge","download_url":"https://codeload.github.com/olafnorge/borgphp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olafnorge%2Fborgphp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28404570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","borgbackup","library"],"created_at":"2026-01-13T23:08:56.246Z","updated_at":"2026-01-13T23:08:57.003Z","avatar_url":"https://github.com/olafnorge.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003ca href=\"https://packagist.org/packages/olafnorge/borgphp\"\u003e\u003cimg src=\"https://poser.pugx.org/olafnorge/borgphp/d/total.svg\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/olafnorge/borgphp\"\u003e\u003cimg src=\"https://poser.pugx.org/olafnorge/borgphp/v/stable.svg\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/olafnorge/borgphp\"\u003e\u003cimg src=\"https://poser.pugx.org/olafnorge/borgphp/license.svg\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# Library to execute arbitrary BorgBackup commands\n\n[From Borg Documentation: What is BorgBackup?](https://borgbackup.readthedocs.io/en/stable/#what-is-borgbackup \"What is BorgBackup?\")\n\n\u003e BorgBackup (short: Borg) is a deduplicating backup program. Optionally, it supports compression and authenticated\n\u003e encryption.\n\u003e \n\u003e The main goal of Borg is to provide an efficient and secure way to backup data. The data deduplication technique\n\u003e used makes Borg suitable for daily backups since only changes are stored. The authenticated encryption technique\n\u003e makes it suitable for backups to not fully trusted targets.\n\nThis library makes use of the borg binary and executes arbitrary commands through the underlying [Symfony Process\ncomponent](https://github.com/symfony/process). It's essential for the library to be able to execute the binary\ntherefore it needs to be installed beforehand. The library itself does not check if the command is available before\nexecuting it and will fail with a ProcessFailedException bubbled up from the Symfony Process component.\n\n## Installation of BorgBackup (the binary itself)\n\nPlease refer to [the official documentation](https://borgbackup.readthedocs.io/en/stable/installation.html) of Borg to\nget an idea which installation method suites best for your OS. \n\n## Installation of the library\n\n```bash\ncomposer require olafnorge/borgphp\n```\n\n## Usage\n\nThe library directly passes through all command parameters and options to the underlying BorgBackup binary. It takes care\nof the proper position of the parameters and options and does some validation if they align with the expected format of\nBorgBackup. All you need to do is passing the parameters and options as array to the command you want to execute.\n\n```php\n\u003c?php\n// list the contents of a repository or an archive \nuse olafnorge\\borgphp\\ListCommand;\n\n$listCommand = new ListCommand(['\u003cREPOSITORY_OR_ARCHIVE\u003e']);\n$contents = $listCommand-\u003emustRun()-\u003egetOutput();\nvar_dump($contents);\n```\n\n## Status of implementation\n\nFor now only some commands are fully implemented because I didn't have a use case for the missing commands yet. Below\nyou find a list of what is done so far. As mentioned already the parameters and options are directly passed through to\nthe borg binary. To be able to make use of a command that fits your needs I referenced the official documentation of each\ncommand next to it.\n\n| Command        | Official BorgBackup Documentation |\n| ------------- | ------------- |\n| config      | https://borgbackup.readthedocs.io/en/stable/usage/config.html#borg-config |\n| create      | https://borgbackup.readthedocs.io/en/stable/usage/create.html#borg-create |\n| export-tar | https://borgbackup.readthedocs.io/en/stable/usage/tar.html#borg-export-tar |\n| info | https://borgbackup.readthedocs.io/en/stable/usage/info.html#borg-info |\n| init | https://borgbackup.readthedocs.io/en/stable/usage/init.html#borg-init |\n| list | https://borgbackup.readthedocs.io/en/stable/usage/list.html#borg-list |\n\nContributions are highly welcome and appreciated. I will only add additional commands by myself if I have an own need,\nbut if you have a need a PR would be more than welcomed.\n\n# License\n\nBorgPHP is open-sourced software licensed under the [MIT license](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folafnorge%2Fborgphp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folafnorge%2Fborgphp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folafnorge%2Fborgphp/lists"}