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