diff --git a/internal/api/resolver_mutation_configure.go b/internal/api/resolver_mutation_configure.go index 9cf3ac9a4..0252192e7 100644 --- a/internal/api/resolver_mutation_configure.go +++ b/internal/api/resolver_mutation_configure.go @@ -86,7 +86,7 @@ func (r *mutationResolver) ConfigureGeneral(ctx context.Context, input ConfigGen existingBackupDirectoryPath := c.GetBackupDirectoryPath() if input.BackupDirectoryPath != nil && existingBackupDirectoryPath != *input.BackupDirectoryPath { - if err := validateDir(config.BackupDirectoryPath, *input.BackupDirectoryPath, false); err != nil { + if err := validateDir(config.BackupDirectoryPath, *input.BackupDirectoryPath, true); err != nil { return makeConfigGeneralResult(), err } diff --git a/pkg/sqlite/database.go b/pkg/sqlite/database.go index 07641c85e..26e4ead8c 100644 --- a/pkg/sqlite/database.go +++ b/pkg/sqlite/database.go @@ -255,7 +255,7 @@ func (db *Database) DatabasePath() string { } func (db *Database) DatabaseBackupPath(backupDirectoryPath string) string { - fn := fmt.Sprintf("%s.%d.%s", db.dbPath, db.schemaVersion, time.Now().Format("20060102_150405")) + fn := fmt.Sprintf("%s.%d.%s", filepath.Base(db.dbPath), db.schemaVersion, time.Now().Format("20060102_150405")) if backupDirectoryPath != "" { return filepath.Join(backupDirectoryPath, fn)