Prune, beginner asking for validation

I have been searching the forum and would love to have someone experienced to verify my understanding of the prune command:

I want to keep a revision
daily for the last week
weekly for the last month
monthly for the last quarter
quarterly for the last year
and delete every revision older than a year

prune scheme:
-keep 0:366 -keep 90:365 -keep 30:90 -keep 7:30 -keep 1:7

Did I understand the documentation correctly?

Thanks for your support, Michael

It’s <every time period>:<for stuff older-than>. i.e.

-keep 219:303 will keep one revision every 219 days and apply to revisions that are older than 303 days old.

1 revision every day for stuff older than 1 day:

-keep 1:1

One revision every 7 days for things older than 7 days (because things younger than seven days will be addressed by rule above)

  -keep 7:7

One revision every 30 days for things older than a month (because things younger than a month will be addressed by rules above):

-keep 30:30

One revision every quarter for things older than a quarter (because things younger than a quarter… you get he idea)

-keep 90:90

Also dont’ forget to specify which snapshot ID to prune, or use -a flag to prune all snapshot IDs.

Then sort keep flags, and this woudl be the final one:

duplicacy prune -a -keep 0:365 -keep 90:90 -keep 30:30 -keep 7:7 -keep 1:1
1 Like

Thanks for the fast response and great explanation! :heart_eyes: