component/snapshots: Create new component

This commit creates a new 'snapshots' component that is intended to
manage snapshots and backups.
This commit is contained in:
Tom Wiesing 2022-10-01 19:39:41 +02:00
parent ea56ff4aac
commit f58920baf4
No known key found for this signature in database
7 changed files with 89 additions and 63 deletions

View file

@ -14,7 +14,7 @@ func (dis *Distillery) ShouldPrune(modtime time.Time) bool {
// PruneBackups prunes all backups older than the maximum backup age
func (dis *Distillery) PruneBackups(io stream.IOStream) error {
sPath := dis.SnapshotsArchivePath()
sPath := dis.Snapshots().ArchivePath()
// list all the files
entries, err := dis.Core.Environment.ReadDir(sPath)