Backups: Improve command-line backup and restore commands #4243

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-05-15 15:25:30 +02:00
parent 6a1c92a8af
commit ca78305eac
5 changed files with 23 additions and 20 deletions

View File

@@ -98,12 +98,12 @@ func restoreAction(ctx *cli.Context) error {
}
if !fs.PathExists(albumsPath) {
log.Warnf("restore: album files path %s not found", clean.Log(albumsPath))
log.Warnf("restore: failed to open %s, album backups cannot be restored", clean.Log(albumsPath))
} else {
log.Infof("restore: restoring albums from %s", clean.Log(albumsPath))
log.Infof("restore: restoring album backups from %s", clean.Log(albumsPath))
if count, err := photoprism.RestoreAlbums(albumsPath, true); err != nil {
return err
if count, restoreErr := photoprism.RestoreAlbums(albumsPath, true); restoreErr != nil {
return restoreErr
} else {
log.Infof("restore: restored %s from YAML files", english.Plural(count, "album", "albums"))
}