-$Id: CHANGES,v 1.117 2001/06/18 10:58:27 stelian Exp $
+$Id: CHANGES,v 1.118 2001/06/18 11:07:45 stelian Exp $
Changes between versions 0.4b22 and 0.4b23 (released ????????????)
==================================================================
latest version of this file. Patch submitted by
Andreas Dilger <adilger@turbolinux.com>.
+4. Report any filesystem present in either /etc/fstab with a
+ positive passno or /etc/dumpdates in dump -w output.
+ Patch submitted by Andreas Dilger <adilger@turbolinux.com>.
+
Changes between versions 0.4b21 and 0.4b22 (released May 12, 2001)
==================================================================
#ifndef lint
static const char rcsid[] =
- "$Id: optr.c,v 1.23 2001/06/18 10:58:28 stelian Exp $";
+ "$Id: optr.c,v 1.24 2001/06/18 11:07:45 stelian Exp $";
#endif /* not lint */
#include <config.h>
strcmp(fs->fs_type, FSTAB_RQ))
continue;
fs = allocfsent(fs);
- fs->fs_passno = 0;
if ((pf = (struct pfstab *)malloc(sizeof (*pf))) == NULL)
quit("%s\n", strerror(errno));
pf->pf_fstab = fs;
print_wmsg(char arg, int dumpme, const char *dev, int level,
const char *mtpt, time_t ddate)
{
- char *date = NULL;
-
- if (ddate) {
- char *d;
- date = (char *)ctime(&ddate);
- d = strchr(date, '\n');
- if (d) *d = '\0';
- }
-
+#ifdef FDEBUG
+ printf("checking dev %s: lvl %d, mtpt %s\n", dev, level, mtpt);
+#endif
if (!dumpme && arg == 'w')
return;
dev,
mtpt ? mtpt : "");
- if (ddate)
- printf("Level %c, Date %s\n",
- level, date);
- else
+ /*
+ * Check ddate > 365 to avoid issues with fs in stab but not dumpdates.
+ * Not a problem, because ddate is in seconds since the epoch anyways.
+ */
+ if (ddate > 365) {
+ char *date, *d;
+
+ date = (char *)ctime(&ddate);
+ d = strchr(date, '\n');
+ if (d) *d = '\0';
+ printf("Level %c, Date %s\n", level, date);
+ } else
printf("never\n");
}
else
(void) printf("Last dump(s) done (Dump '>' file systems):\n");
+ /* For files in dumpdates, get the last dump level and date */
if (ddatev != NULL) {
struct dumpdates *dtwalk = NULL;
int i;
/* Overload fs_freq as dump level and
* fs_passno as date, because we can't
* change struct fstab format.
- * A negative fs_freq means this
+ * A positive fs_freq means this
* filesystem needs to be dumped.
*/
dt->fs_passno = dtwalk->dd_ddate;
if (dt->fs_freq > 0 && (dtwalk->dd_ddate <
tnow - (dt->fs_freq * 86400)))
- dt->fs_freq = -dtwalk->dd_level - 1;
+ dt->fs_freq = dtwalk->dd_level;
else
- dt->fs_freq = dtwalk->dd_level + 1;
-
+ dt->fs_freq = -dtwalk->dd_level;
+#ifdef FDEBUG
+ printf("%s fs_freq set to %d\n", lastname,
+ dt->fs_freq);
+#endif
}
}
}
if (strncmp(dt->fs_vfstype, *type,
sizeof(dt->fs_vfstype)) == 0) {
const char *disk = get_device_name(dt->fs_spec);
- print_wmsg(arg, dt->fs_freq < 0,
+ print_wmsg(arg, dt->fs_freq > 0,
disk ? disk : dt->fs_spec,
- dt->fs_freq < 0 ? -dt->fs_freq - 1 : dt->fs_freq - 1,
+ dt->fs_freq < 0 ? -dt->fs_freq :
+ dt->fs_freq,
dt->fs_file,
dt->fs_passno);
}