restore(restic): flatten restored data into target pvc root
This commit is contained in:
parent
d9dd73d831
commit
cb23f76090
@ -327,7 +327,10 @@ func backupCommand(cfg *config.Config, req api.BackupRequest) string {
|
||||
}
|
||||
|
||||
func restoreCommand(snapshot string) string {
|
||||
return fmt.Sprintf("set -euo pipefail; restic restore %s --target /restore", snapshot)
|
||||
return fmt.Sprintf(
|
||||
"set -euo pipefail; rm -rf /cache/restore && mkdir -p /cache/restore; restic restore %s --target /cache/restore; if [ -d /cache/restore/data ]; then cp -a /cache/restore/data/. /restore/; else cp -a /cache/restore/. /restore/; fi",
|
||||
snapshot,
|
||||
)
|
||||
}
|
||||
|
||||
func resticEnv(cfg *config.Config, secretName string) []corev1.EnvVar {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user