| 339 | } |
| 340 | |
| 341 | func printRestoreStats(ctx context.Context, st *restore.Stats) { |
| 342 | var maybeSkipped, maybeDeletedDirs, maybeDeletedFiles, maybeDeletedSymlinks, maybeErrors string |
| 343 | |
| 344 | if st.SkippedCount > 0 { |
| 345 | maybeSkipped = fmt.Sprintf(", skipped %v (%v)", st.SkippedCount, units.BytesString(st.SkippedTotalFileSize)) |
| 346 | } |
| 347 | |
| 348 | if st.DeletedDirCount > 0 { |
| 349 | maybeDeletedDirs = fmt.Sprintf(", deleted directories %v", st.DeletedDirCount) |
| 350 | } |
| 351 | |
| 352 | if st.DeletedFilesCount > 0 { |
| 353 | maybeDeletedFiles = fmt.Sprintf(", deleted files %v", st.DeletedFilesCount) |
| 354 | } |
| 355 | |
| 356 | if st.DeletedSymlinkCount > 0 { |
| 357 | maybeDeletedSymlinks = fmt.Sprintf(", deleted symbolic links %v", st.DeletedSymlinkCount) |
| 358 | } |
| 359 | |
| 360 | if st.IgnoredErrorCount > 0 { |
| 361 | maybeErrors = fmt.Sprintf(", ignored %v errors", st.IgnoredErrorCount) |
| 362 | } |
| 363 | |
| 364 | log(ctx).Infof("Restored %v files, %v directories and %v symbolic links (%v)%v%v%v%v%v.\n", |
| 365 | st.RestoredFileCount, |
| 366 | st.RestoredDirCount, |
| 367 | st.RestoredSymlinkCount, |
| 368 | units.BytesString(st.RestoredTotalFileSize), |
| 369 | maybeSkipped, maybeDeletedDirs, maybeDeletedFiles, maybeDeletedSymlinks, maybeErrors) |
| 370 | } |
| 371 | |
| 372 | func (c *commandRestore) setupPlaceholderExpansion(ctx context.Context, rep repo.Repository, rstp restoreSourceTarget, output restore.Output) (fs.Entry, error) { |
| 373 | rootEntry, err := snapshotfs.GetEntryFromPlaceholder(ctx, rep, localfs.PlaceholderFilePath(rstp.source)) |