f7518c0529
- Auto-enable daily rsync Tier 2 for apps without HDD mounts when ≥2 storage paths exist (AutoEnableSmallApps) - Sync infrastructure config (stacks dir + controller.yaml) to all secondary destinations via _infra/ directory (syncInfraConfig) - Include infra paths in cross-drive restic snapshots - Add SecondaryInfraPath() helper to paths.go Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
44 lines
1.6 KiB
Go
44 lines
1.6 KiB
Go
package backup
|
|
|
|
import "path/filepath"
|
|
|
|
// PrimaryBackupPath returns the root primary backup directory for a drive.
|
|
func PrimaryBackupPath(drivePath string) string {
|
|
return filepath.Join(drivePath, "backups", "primary")
|
|
}
|
|
|
|
// PrimaryResticRepoPath returns the restic repo path on a drive's primary backup.
|
|
func PrimaryResticRepoPath(drivePath string) string {
|
|
return filepath.Join(drivePath, "backups", "primary", "restic")
|
|
}
|
|
|
|
// AppDBDumpPath returns the DB dump directory for an app on its home drive.
|
|
func AppDBDumpPath(drivePath, stackName string) string {
|
|
return filepath.Join(drivePath, "backups", "primary", stackName, "db-dumps")
|
|
}
|
|
|
|
// SecondaryBackupPath returns the root secondary backup directory for a drive.
|
|
func SecondaryBackupPath(drivePath string) string {
|
|
return filepath.Join(drivePath, "backups", "secondary")
|
|
}
|
|
|
|
// AppSecondaryRsyncPath returns the rsync destination for an app's secondary backup.
|
|
func AppSecondaryRsyncPath(drivePath, stackName string) string {
|
|
return filepath.Join(drivePath, "backups", "secondary", stackName, "rsync")
|
|
}
|
|
|
|
// SecondaryResticRepoPath returns the restic repo path on a drive's secondary backup.
|
|
func SecondaryResticRepoPath(drivePath string) string {
|
|
return filepath.Join(drivePath, "backups", "secondary", "restic")
|
|
}
|
|
|
|
// SecondaryInfraPath returns the infrastructure config mirror directory on a drive's secondary backup.
|
|
func SecondaryInfraPath(drivePath string) string {
|
|
return filepath.Join(drivePath, "backups", "secondary", "_infra")
|
|
}
|
|
|
|
// AppDataDir returns the app data directory path on a drive.
|
|
func AppDataDir(drivePath, stackName string) string {
|
|
return filepath.Join(drivePath, "appdata", stackName)
|
|
}
|