tldr/pages/common/borg.md

34 lines
1.1 KiB
Markdown
Raw Normal View History

2017-11-18 03:52:18 +00:00
# borg
> Deduplicating backup tool.
> Creates local or remote backups that are mountable as filesystems.
> More information: <https://borgbackup.readthedocs.io/en/stable/usage/general.html>.
2017-11-18 03:52:18 +00:00
2022-06-27 11:23:12 +01:00
- Initialize a (local) repository:
2017-11-18 03:52:18 +00:00
`borg init {{path/to/repo_directory}}`
2017-11-18 03:52:18 +00:00
- Backup a directory into the repository, creating an archive called "Monday":
2017-11-18 03:52:18 +00:00
`borg create --progress {{path/to/repo_directory}}::{{Monday}} {{path/to/source_directory}}`
2017-11-18 03:52:18 +00:00
- List all archives in a repository:
`borg list {{path/to/repo_directory}}`
2017-11-18 03:52:18 +00:00
- Extract a specific directory from the "Monday" archive in a remote repository, excluding all `*.ext` files:
2017-11-18 03:52:18 +00:00
`borg extract {{user}}@{{host}}:{{path/to/repo_directory}}::{{Monday}} {{path/to/target_directory}} --exclude '{{*.ext}}'`
2017-11-18 03:52:18 +00:00
- Prune a repository by deleting all archives older than 7 days, listing changes:
`borg prune --keep-within {{7d}} --list {{path/to/repo_directory}}`
2017-11-18 03:52:18 +00:00
- Mount a repository as a FUSE filesystem:
`borg mount {{path/to/repo_directory}}::{{Monday}} {{path/to/mountpoint}}`
2017-11-18 03:52:18 +00:00
- Display help on creating archives:
`borg create --help`