1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2024-12-23 16:26:11 +00:00

backup: Correct keep policy text

Makes the following corrections to the "Applying Policy:" output:

- keep the last 1 snapshots snapshots => keep 1 latest snapshots
- keep the last 1 snapshots, 3 hourly, 5 yearly snapshots => keep 1 latest, 3 hourly, 5 yearly snapshots
This commit is contained in:
Leo R. Lundgren 2020-09-28 12:54:13 +02:00
parent 94136132e3
commit 028c9a5343

View file

@ -25,7 +25,7 @@ type ExpirePolicy struct {
func (e ExpirePolicy) String() (s string) { func (e ExpirePolicy) String() (s string) {
var keeps []string var keeps []string
if e.Last > 0 { if e.Last > 0 {
keeps = append(keeps, fmt.Sprintf("%d snapshots", e.Last)) keeps = append(keeps, fmt.Sprintf("%d latest", e.Last))
} }
if e.Hourly > 0 { if e.Hourly > 0 {
keeps = append(keeps, fmt.Sprintf("%d hourly", e.Hourly)) keeps = append(keeps, fmt.Sprintf("%d hourly", e.Hourly))
@ -44,7 +44,7 @@ func (e ExpirePolicy) String() (s string) {
} }
if len(keeps) > 0 { if len(keeps) > 0 {
s = fmt.Sprintf("keep the last %s snapshots", strings.Join(keeps, ", ")) s = fmt.Sprintf("keep %s snapshots", strings.Join(keeps, ", "))
} }
if len(e.Tags) > 0 { if len(e.Tags) > 0 {