Case Studies
Each of all possible automatic deletion criteria combinations can be assigned to exactly one of four criteria groups:
Consider the age criteria but ignore the count criteria.
Consider the count criteria but ignore the age criteria.
Consider both the age and count criteria and ensure that both criteria are fulfilled.
Consider both the age and count criteria but be satisfied if just one of them is fulfilled.
The following subsections provide case studies for each of these criteria groups. For all these case studies the following initial situation is assumed:
Automatic deletion shall be enabled for a newly imported root directory.
This root directory (or an arbitrary descending subdirectory of it) contains a file named HypotheticalSourceFile.swift .
For this file 350 old file version snapshots are stored and these snapshots can be grouped as follows:
25 snapshots are younger than a day
75 snapshots are older than a day
150 snapshots are even older than a week
100 snapshots are even older than a month
The figure below illustrates how these old file version snapshots are grouped depending on their age:
Criteria group 1
Settings:
Older than: One Month
More than: Ignore Count
When applying these settings, automatic deletion performs the following steps:
The oldest 100 snapshots will be deleted immediately (because they are older than a month).
Calculate when the oldest snapshot of the remaining snapshots will became older than a month and wait until this snapshot expires.
As soon as the oldest snapshot of the remaining snapshots expires delete it.
Check if there is at least one snapshot left and if so continue with step 2.
Remove the entry for the file HypotheticalSourceFile.swift from the Navigator View . This step will only be reached if there’s no more old file version snapshot left for HypotheticalSourceFile.swift . As soon as the file gains a new old file version snapshot again, reinsert the file into the Navigator View and continue with step 2.
Criteria group 2
Settings:
Older than: Ignore Age
More than: 300
When applying these settings, automatic deletion performs the following steps:
The oldest 50 snapshots will be deleted immediately (because 350 - 300 = 50)
From then on, every time a new snapshot has been stored for HypotheticalSourceFile.swift . check if there’re more than 300 old file version snapshots for this file now - this needn’t be the case, because the system may have deleted old file versions snapshots in the meanwhile, for instance. If there are more than 300 old file version snapshots reduce the amount of old file version snapshots to 300 by deleting the appropriate number of the oldest snapshots stored for this file.
Note that even if the age criteria is ignored automatic deletion always deletes the oldest old file version snapshots, of course.
If new snapshots are added within an extremely short time span (even for different files) automatic deletion doesn’t start a riot. In such cases it delays deletion of old file version snapshots and carries on with doing its job as soon as things calm down again.
Criteria group 3
Settings example 1:
Older than: One Month
- And -
More than: 300
When applying these settings, automatic deletion performs the following steps:
The oldest 50 snapshots will be deleted immediately (because 350 - 300 = 50; according to the settings, the youngest 300 snapshots must be kept even if there are snapshots older than one month left).
From then on, as long as there are snapshots older than one month, every time a new snapshot has been stored for HypotheticalSourceFile.swift the number of stored old snapshots will be reduced to 300 by deleting an appropriate count of the oldest snapshots older than a month. If there are not enough snapshots left that are older than a month, only those snapshots will be deleted, that are older than a month. Therefore, some time later, there may be more than 300 snapshots for HypotheticalSourceFile.swift : if more and more snapshots are stored for HypotheticalSourceFile.swift in a relatively short time period there may be no further snapshot older than a month. Because of the ‘And’ condition, snapshots younger than a month mustn’t be deleted. In this case the step 2 stated for the criteria main group 1 will be performed. The step 2 of this criteria group (i.e. group 3) will be repeated every time a new snapshot has been stored for HypotheticalSourceFile.swift or if there are more than 300 old file version snapshots and an existing old file version snapshot has expired.
Settings example 2:
Older than: One Month
- And -
More than: 100
When applying these settings, automatic deletion performs the following steps:
The oldest 100 snapshots will be deleted immediately (because there are more than 100 snapshots younger than a month, all snapshots older than a month can be deleted).
This step is equal to step 2 above ( settings example 1 ), with the only exception that this step enters with more remaining snapshots than the required minimum number of snapshots (100) that must be kept.
Criteria group 4
Settings example 1:
Older than: One Month
- Or -
More than: 300
When applying these settings, automatic deletion performs the following steps:
The oldest 100 snapshots will be deleted immediately (because they are older than a month; the ‘Older than’ criteria wins against the ‘More than’ criteria in this case).
From then on - in simple terms - the steps 2-5 stated for the criteria group 1 and the step 2 stated for the criteria group 2 will be performed simultaneously (but with another values for the ‘More than’ criteria, of course).
Settings example 2:
Older than: One Month
- Or -
More than: 100
When applying these settings, automatic deletion performs the following steps:
The oldest 250 snapshots will be deleted immediately (because 350 - 100 = 250; the ‘More than’ criteria wins against the ‘Older than’ criteria in this case).
From then on - in simple terms - the steps 2-5 stated for the criteria group 1 and the step 2 stated for the criteria group 2 will be performed simultaneously.
Copyright © 2017-2022 HABELITZ Software Developments
Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other countries.