av[i]);
/* not reached */
}
+ if (fsfd < 0)
+ fsfd = open(".", O_RDONLY);
snapshot_del(fsfd, tid);
} else if (S_ISDIR(st.st_mode)) {
if (fsfd >= 0)
snapshot.count = 1;
snapshot.snaps[0].tid = tid;
+ /*
+ * Do not abort if we are unable to remove the meta-data.
+ */
if (ioctl(fsfd, HAMMERIOC_DEL_SNAPSHOT, &snapshot) < 0) {
- err(2, "hammer snaprm 0x%016jx", (uintmax_t)tid);
+ err(2, "hammer snaprm 0x%016jx",
+ (uintmax_t)tid);
+ } else if (snapshot.head.error == ENOENT) {
+ fprintf(stderr, "Warning: hammer snaprm 0x%016jx: "
+ "meta-data not found\n",
+ (uintmax_t)tid);
} else if (snapshot.head.error) {
- fprintf(stderr, "hammer snaprm 0x%016jx: %s\n",
+ fprintf(stderr, "Warning: hammer snaprm 0x%016jx: %s\n",
(uintmax_t)tid, strerror(snapshot.head.error));
}
}
.Cm snapls
directive to get a definitive list from the meta-data and
regenerate them from that list.
+.Pp
+WARNING! If you are using hammer to backup filesystems your scripts
+may be using the
+.Cm synctid
+directive to generate transaction ids. This directive does not create
+a snapshot. You will have to modify your scripts to use the
+.Cm snapq
+directive to generate the linkbuf for the softlink you create, or
+use one of the other
+.Cm snap*
+directives.
+The older
+.Cm snapshot
+directive will continue to work as expected and in V3 it will also
+record the snapshot transaction id in meta-data. You may also want
+to make use of the new 'note' tag for the meta-data.
+.Pp
+WARNING! If you used to remove snapshot softlinks with
+.Nm rm
+you should probably start using the
+.Cm snaprm
+directive instead to also remove the related meta-data.
+The pruning code scans the meta-data so just removing the
+softlink is not sufficient.
.Sh FILES
.Bl -tag -width ".It Pa <fs>/var/slaves/<name>" -compact
.It Pa <pfs>/snapshots