borg-export-tar(1)

✨ borg-export-tar ✨

okay bestie, welcome to borg-export-tar(1) β€” yes that's the whole manual page name, she's a borg backup tool and she's here to turn your archive into a tarball πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

borg [common options] export-tar [options] ARCHIVE FILE [PATH...]

like, that's the whole vibe check right there. common options go first, then export-tar does her thing ✨


πŸ’– DESCRIPTION πŸ’–

so what does she actually do? this command creates a tarball from an archive. iconic. main character energy fr fr 🫢

when you pass - as the output FILE, Borg will write a tar stream to standard output. no cap.

by default (--tar-filter=auto), Borg will detect whether the FILE should be compressed based on its file extension and pipe the tarball through an appropriate filter before writing it to FILE:

  • .tar.gz or .tgz: gzip
  • .tar.bz2 or .tbz: bzip2
  • .tar.xz or .txz: xz
  • .tar.zstd or .tar.zst: zstd
  • .tar.lz4: lz4

she reads your extension and just knows. the way that works?? obsessed 😭

alternatively, a --tar-filter program may be explicitly specified. it should read the uncompressed tar stream from stdin and write a compressed/filtered tar stream to stdout. so like, it's a little pipe girly, you feed her in, she spits out 🌸

the generated tarball uses the GNU tar format. periodt.

⚠️ okay important one: export-tar is a lossy conversion 🫒 BSD flags, ACLs, extended attributes (xattrs), atime and ctime are not exported. timestamp resolution is limited to whole seconds, not the nanosecond resolution otherwise supported by Borg. so like, some of the lil details stay home. don't shoot the messenger πŸ’€
also: a --sparse option (as found in borg extract) is not supported. she said no πŸ’…

by default the entire archive is extracted but a subset of files and directories can be selected by passing a list of PATHs as arguments. the file selection can further be restricted by using the --exclude option. like, you can be picky, she supports it πŸ₯°

for more help on include/exclude patterns, see the borg_patterns command output. iykyk.

ngl, --progress can be slower than no progress display, since it makes one additional pass over the archive metadata. worth it for the lil bar though? your call bestie πŸ’œ


🌈 OPTIONS 🌈

see borg-common(1) for common options of Borg commands. (yes, the common ones go hang out over there.)

πŸ¦‹ arguments

  • ARCHIVE β€” the archive to export. your lil archive babe πŸŽ€
  • FILE β€” output tar file. "-" to write to stdout instead. dash means straight to stdout, no files harmed 🫢
  • PATH β€” paths to extract; patterns are supported ✨

πŸ’… options

  • --tar-filter β€” filter program to pipe data through. the middleman. the connector. the -girl 🌸
  • --list β€” output verbose list of items (files, dirs, ...) so you can see everything she did πŸ‘‘

πŸ“ Include/Exclude options

  • -e PATTERN, --exclude PATTERN β€” exclude paths matching PATTERN. not today, sweetie πŸ™ˆ
  • --exclude-from EXCLUDEFILE β€” read exclude patterns from EXCLUDEFILE, one per line ✨
  • --pattern PATTERN β€” include/exclude paths matching PATTERN. she contains multitudes πŸ’–
  • --patterns-from PATTERNFILE β€” read include/exclude patterns from PATTERNFILE, one per line 🌸
  • --strip-components NUMBER β€” Remove the specified number of leading path elements. Paths with fewer elements will be silently skipped. (silently!! she's not gonna make a scene about it πŸ’€)

πŸ”₯ EXAMPLES πŸ”₯

okay slay, let's see her in action:

# Export as an uncompressed tar.
$ borg export-tar /path/to/repo::Monday Monday.tar

# Exclude some types; compress using gzip.
$ borg export-tar /path/to/repo::Monday Monday.tar.gz --exclude '*.so'

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

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

# Remote extraction via "tarpipe".
$ borg export-tar /path/to/repo::Monday - | ssh somewhere "cd extracted; tar x"

the curl one and the ssh "tarpipe" one?? literally the moment she ate and left no crumbs πŸ”₯ piping straight into the void is such a power move fr fr πŸ‘‘


🌟 SEE ALSO 🌟


πŸ‘‘ Author πŸ‘‘

The Borg Collective


and that's the whole page bestie!! πŸ₯³ source borg backup tool, page dated 2026-07-18, manual page borg-export-tar(1) β€” go forth and export your tars, you're gonna do amazing πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from