mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 12:24:38 +03:00
Fix backup issues (#2966)
Make backup directory setting optional. Use the basename of the database file for the naming.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user