Prompt for backup location during re-onboard instead of skipping

When step 4 finds an existing backup repo, show the current location
and ask to reconfigure with the existing path as default, rather than
silently skipping the step.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-23 13:51:24 -05:00
parent 3be9586238
commit ec5e77f796

View File

@@ -1411,21 +1411,24 @@ fn doOnboardSteps(): Unit with {Console, Process} = {
printHint("Install restic and run 'pal backup init <repo>' later.")
} else {
let existingRepo = getBackupRepo()
if String.length(existingRepo) > 0 then {
printStep("Backup repository", "already configured")
printHint("Repository: " + existingRepo)
} else {
let setupBackup = askConfirm("Set up backups?", true)
let setupBackup = if String.length(existingRepo) > 0 then {
printHint("Current repository: " + existingRepo)
print("")
if setupBackup then {
printHint("Enter a path or URL where backup snapshots will be stored.")
print("")
let ignore15b = Process.exec("printf ' \\033[36mLocal directory\\033[0m /mnt/backup, /media/usb/backups\\n' >&2")
let ignore15c = Process.exec("printf ' \\033[36mSFTP (SSH)\\033[0m sftp:user@host:/backups\\n' >&2")
let ignore15d = Process.exec("printf ' \\033[36mBackblaze B2\\033[0m b2:bucket-name:path\\n' >&2")
let ignore15e = Process.exec("printf ' \\033[36mAmazon S3\\033[0m s3:bucket-name/path\\n' >&2")
print("")
let backupRepo = askInput("Backup location", "")
askConfirm("Reconfigure backup location?", false)
} else {
askConfirm("Set up backups?", true)
}
print("")
if setupBackup then {
let defaultRepo = existingRepo
printHint("Enter a path or URL where backup snapshots will be stored.")
print("")
let ignore15b = Process.exec("printf ' \\033[36mLocal directory\\033[0m /mnt/backup, /media/usb/backups\\n' >&2")
let ignore15c = Process.exec("printf ' \\033[36mSFTP (SSH)\\033[0m sftp:user@host:/backups\\n' >&2")
let ignore15d = Process.exec("printf ' \\033[36mBackblaze B2\\033[0m b2:bucket-name:path\\n' >&2")
let ignore15e = Process.exec("printf ' \\033[36mAmazon S3\\033[0m s3:bucket-name/path\\n' >&2")
print("")
let backupRepo = askInput("Backup location", defaultRepo)
if String.length(backupRepo) == 0 then {
printHint("Skipping backup setup.")
printCmd("pal backup init <repo>")
@@ -1454,11 +1457,10 @@ fn doOnboardSteps(): Unit with {Console, Process} = {
printCmd("pal backup init " + backupRepo)
}
}
} else {
printHint("Skipping backup setup.")
printHint("Set this up later with:")
printCmd("pal backup init <repo>")
}
} else {
printHint("Skipping backup setup.")
printHint("Set this up later with:")
printCmd("pal backup init <repo>")
}
}