// age = age in days, lastAge = age of last (more recent) file kept (also in days) sbool defaultAgeBasedBackupRetentionStrategy_shouldKeep(double age, double lastAge) { if (age <= 0.5) true; // keep all backups of last 12 hours if (age <= 7 && age >= lastAge+1) true; // keep every daily backup from this week if (age <= 28 && >= lastAge+7) true; // weekly backups for 3 more weeks if (age >= lastAge+365.0/12) true; // after 4 weeks, switch to monthly (roundabout) false; }