borg-key-import(1)
π borg-key-import(1) π
okay bestie, welcome to borg-key-import β it's part of the borg backup tool and it's literally the glow-up-your-keys chapter of the borg saga. no cap.
β¨ SYNOPSIS β¨
borg [common options] key import [options] [PATH]
that's the whole vibe. borg, some common options, the words key import, a few options, and maybe a PATH if you're feeling generous. π«Ά
πΈ DESCRIPTION πΈ
So here's the tea: this command restores a key that you previously backed up with the export command. it's the uno reverse card for your keys. π
If you pass the --paper option, the import becomes an interactive process β borg goes line by line, checking each one for plausibility before it moves to the next. think of it like a vibe check but for every single line. and heads up: for this format, PATH must not be given. don't do it. it's giving "please don't". π
Where your imported key actually lands is decided by --key-location:
repokey(the default, the main character): the key is stored in the repository, and no local key file gets written. clean. minimal. β¨keyfile: the key is stored in a local key file. very "i keep my secrets close" of it.
Now, which key file --key-location=keyfile writes to depends on a few things, so pay attention bestie:
- If the
BORG_KEY_FILEenvironment variable is set and non-empty,borg key importcreates or overwrites the file named by$BORG_KEY_FILE. blunt. direct. iconic. - Otherwise,
borg key importsearches the$BORG_KEYS_DIRdirectory for a key file associated with the repository.- If one is found there,
borg key importoverwrites it. - Otherwise, it creates a new key file in
$BORG_KEYS_DIR.
- If one is found there,
so basically it goes: env var? use that. no env var? go hunting in $BORG_KEYS_DIR. found one? overwrite. not found? brand new file, baby. π
π₯ OPTIONS π₯
See borg-common(1) for common options of Borg commands. (yes, that's a real page, go read it, i'll wait.)
π arguments π
PATHβ path to the backup (-to read from stdin). yes, a literal dash means "read it from stdin", she's flexible like that. π
π¦ options π¦
--paperβ interactively import from a backup done with--paper. every line gets scrutinised, so stay seated and stay honest. π--key-location LOCATIONβ where to store the imported key:'repokey'(in the repository, default) or'keyfile'(in the local keys directory). pick your fighter. π
π SEE ALSO π
π Author π
The Borg Collective. the whole squad. no individual credits, just collective slay. π
and that's the whole page, bestie β you ate. this was borg-key-import(1) from the borg backup tool, dated 2026-10-07, brought to you by The Borg Collective. go import those keys, you've got this. ππ¦β¨
π¦ where this page comes from
- ubuntu stonking: borgbackup2 2.0.0b25-4 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms