scan->prune.head.flags |= HAMMER_IOC_PRUNE_ALL;
} else {
hammer_softprune_scandir(&base, &template, *av);
+ if (base == NULL) {
+ const char *dummylink = "";
+ scan = hammer_softprune_addentry(&base, &template,
+ *av, NULL, NULL,
+ dummylink, dummylink);
+ if (scan == NULL)
+ softprune_usage(1);
+ scan->prune.nelms = 0;
+ }
++av;
--ac;
}
/*
* XXX future (need to store separate cycles for each filesystem)
*/
- if (base == NULL) {
- fprintf(stderr, "No snapshot softlinks found\n");
- exit(1);
- }
if (base->next) {
fprintf(stderr, "Currently only one HAMMER filesystem may "
"be specified in the softlink scan\n");
}
if (scan->prune.nelms == 0 &&
(scan->prune.head.flags & HAMMER_IOC_PRUNE_ALL) == 0) {
+ fprintf(stderr, "No snapshots found\n");
continue;
}
then snapshot generation is disabled, removal of old snapshots are
disabled, and prunes will use
.Cm prune-everything .
+.Pp
If the
.Cm snapshots
directive has a period of 0 but a non-zero retention time
then this command will not create any new snapshots but will remove old
-snapshots it finds based on the retention time.
+snapshots it finds based on the retention time. This form should be
+used on PFS masters where you are generating your own snapshot softlinks
+manually and on PFS slaves when all you wish to do is prune away existing
+snapshots inherited via the mirroring stream.
.Pp
By default only snapshots in the form
.Ql snap- Ns Ar yyyymmdd Ns Op - Ns Ar HHMM