From owner-freebsd-questions Mon Nov 22 8: 3:33 1999 Delivered-To: freebsd-questions@freebsd.org Received: from plains.NoDak.edu (plains.NoDak.edu [134.129.111.64]) by hub.freebsd.org (Postfix) with ESMTP id 58080151FD for ; Mon, 22 Nov 1999 08:03:06 -0800 (PST) (envelope-from tinguely@plains.NoDak.edu) Received: (from tinguely@localhost) by plains.NoDak.edu (8.9.3/8.9.3) id KAA27881; Mon, 22 Nov 1999 10:03:04 -0600 (CST) Date: Mon, 22 Nov 1999 10:03:04 -0600 (CST) From: Mark Tinguely Message-Id: <199911221603.KAA27881@plains.NoDak.edu> To: freebsd-questions@FreeBSD.ORG, jquincy@mail.burlco.lib.nj.us Subject: Re: backup w/o touching files' last-accessed times Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > I'm using "dump" to backup users' e-mail nightly. Unfortunately this > changes the last-accessed time of their INBOX so that their shell only > reports "You have mail" instead of "You have new mail" when they log in. > (Say they receive new mail at 2:55a and the backup is done at 3:00a. The > last-accessed time is greater than the last-modified time, so the shell > assumes the user has already read his latest mail.) something else, like a find, is modifying your file attribute times. dump uses the raw device to create the backup and does not modify the access, modify, nor change attributes of either directory or files. backup programs (like cpio, and tar) that use the filesytem will modify you access times, but not dump. you can use "ls -lu" or a simple "stat" program below to verify, by: # stat /var/mail/* [| less] # or ls -lu # dump 0sf 99999 /dev/null /[var] # stat /var/mail/* [| less] # or ls -lu stat.c: /* display the access, modify and change attributes for a file */ #include #include main(argc, argv) int argc; char **argv; { int i; struct stat buf; if (argc < 2) { puts("Usage: stat file(s)"); exit(1); } for (i = 1; i < argc; i++) { if (stat(argv[i], &buf) < 0) printf("Bad file: %s\n", argv[i]); else { printf("%s:\n", argv[i]); printf(" size: %d\n",buf.st_size); printf(" access time: %s",ctime(&buf.st_atime)); printf(" modify time: %s",ctime(&buf.st_mtime)); printf(" change time: %s",ctime(&buf.st_ctime)); } } } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message