Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/usage/copy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ Examples
~~~~~~~~
::

# create an archive, then keep a copy of it under a stable name:
$ borg create backup-2016-02-15 ~
$ borg copy backup-2016-02-15 known-good
# create an archive, then copy it to an archive with a different name:
$ borg create home ~
$ borg copy home known-good
$ borg repo-list
d7b79fd3 Sat, 2026-08-29 14:39:27 +0200 backup-2016-02-15 tw MacBook-Pro
d7b79fd3 Sat, 2026-08-29 14:39:27 +0200 home tw MacBook-Pro
f81040e3 Sat, 2026-08-29 14:39:27 +0200 known-good tw MacBook-Pro

# the copy is an independent archive:
# after deleting (and compacting away) the original, the copy is still complete.
$ borg delete backup-2016-02-15
$ borg delete home
$ borg compact
$ borg extract known-good

Expand Down
3 changes: 0 additions & 3 deletions docs/usage/create.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ Examples
# Only compress compressible data with lzma,N (N = 0..9)
$ borg create --compression auto,lzma,N arch ~

# Use the short hostname and username as the archive name
$ borg create '{hostname}-{user}' ~

# Back up relative paths by moving into the correct directory first
$ cd /home/user/Documents
# The root directory of the archive will be "projectA"
Expand Down
10 changes: 5 additions & 5 deletions docs/usage/delete.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Examples
# Delete a specific backup archive using its unique archive ID prefix
$ borg delete aid:d34db33f

# Delete all archives whose names begin with the machine's hostname followed by "-"
$ borg delete -a 'sh:{hostname}-*'
# Delete all archives created on this machine
$ borg delete -a 'host:{hostname}'

# Delete all archives whose names contain "-2012-"
$ borg delete -a 'sh:*-2012-*'
# Delete all archives created in 2012
$ borg delete -a 'date:2012'

# See what would be deleted if delete was run without --dry-run
$ borg delete --list --dry-run -a 'sh:*-May-*'
$ borg delete --list --dry-run -a 'date:2012-05'

4 changes: 2 additions & 2 deletions docs/usage/list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Examples
~~~~~~~~
::

$ borg list root-2016-02-15
$ borg list root
drwxr-xr-x root root 0 Mon, 2016-02-15 17:44:27 +0100 .
drwxrwxr-x root root 0 Mon, 2016-02-15 19:04:49 +0100 bin
-rwxr-xr-x root root 1029624 Thu, 2014-11-13 00:08:51 +0100 bin/bash
lrwxrwxrwx root root 6 Fri, 2015-03-27 20:24:26 +0100 bin/bzcmp -> bzdiff
-rwxr-xr-x root root 2140 Fri, 2015-03-27 20:24:22 +0100 bin/bzdiff
...

$ borg list root-2016-02-15 --pattern "- bin/ba*"
$ borg list root --pattern "- bin/ba*"
drwxr-xr-x root root 0 Mon, 2016-02-15 17:44:27 +0100 .
drwxrwxr-x root root 0 Mon, 2016-02-15 19:04:49 +0100 bin
lrwxrwxrwx root root 6 Fri, 2015-03-27 20:24:26 +0100 bin/bzcmp -> bzdiff
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/mount.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ borgfs
$ echo '/mnt/backup /tmp/myrepo fuse.borgfs defaults,noauto 0 0' >> /etc/fstab
$ mount /tmp/myrepo
$ ls /tmp/myrepo
root-2016-02-01 root-2016-02-15
root-1f7b3c2a root-9e4d0b58

.. Note::

Expand Down
9 changes: 4 additions & 5 deletions docs/usage/prune.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ set the reference timestamp for interval calculation.
# Do a dry-run without actually deleting anything.
$ borg prune -v --list --dry-run --keep-daily=7 --keep-weekly=4

# Similar to the above, but only apply to the archive series named '{hostname}':
$ borg prune -v --list --keep-daily=7 --keep-weekly=4 '{hostname}'
# Similar to the above, but only apply to the archive series named 'backup-sys-home':
$ borg prune -v --list --keep-daily=7 --keep-weekly=4 backup-sys-home

# Similar to the above, but apply to archive names starting with the hostname
# of the machine followed by a '-' character:
$ borg prune -v --list --keep-daily=7 --keep-weekly=4 -a 'sh:{hostname}-*'
# Similar to the above, but only apply to archives created on this machine:
$ borg prune -v --list --keep-daily=7 --keep-weekly=4 -a 'host:{hostname}'

# Keep 7 end of day, 4 additional end of week archives,
# and an end of month archive for every month:
Expand Down
12 changes: 6 additions & 6 deletions docs/usage/tar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ Examples
::

# Export as an uncompressed tar archive
$ borg export-tar Monday Monday.tar
$ borg export-tar docs docs.tar

# Import an uncompressed tar archive
$ borg import-tar Monday Monday.tar
$ borg import-tar docs docs.tar

# Exclude some file types and compress using gzip
$ borg export-tar Monday Monday.tar.gz --exclude '*.so'
$ borg export-tar docs docs.tar.gz --exclude '*.so'

# Use a higher compression level with gzip
$ borg export-tar --tar-filter="gzip -9" Monday Monday.tar.gz
$ borg export-tar --tar-filter="gzip -9" docs docs.tar.gz

# Copy an archive from repoA to repoB
$ borg -r repoA export-tar --tar-format=BORG archive - | borg -r repoB import-tar archive -

# Export a tar, but instead of storing it on disk, upload it to a remote site using curl
$ borg export-tar Monday - | curl --data-binary @- https://somewhere/to/POST
$ borg export-tar docs - | curl --data-binary @- https://somewhere/to/POST

# Remote extraction via 'tarpipe'
$ borg export-tar Monday - | ssh somewhere "cd extracted; tar x"
$ borg export-tar docs - | ssh somewhere "cd extracted; tar x"

# Export sparse files (e.g. disk images) as sparse tar members (GNU sparse format 1.0)
$ borg export-tar --sparse disk-images disk-images.tar
Expand Down
2 changes: 1 addition & 1 deletion src/borg/archiver/completion_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
The following argument types have intelligent, context-aware completion:

1. Archive names/IDs (archivename_validator):
- Completes archive names by default (e.g., "my-backup-2024")
- Completes archive names by default (e.g., "my-backup")
- Completes archive IDs when prefixed with "aid:" (e.g., "aid:12345678")
- In zsh and fish, shows archive metadata (name, timestamp, user@host) as descriptions
(tcsh has no completion descriptions)
Expand Down
Loading