From owner-freebsd-questions Fri Sep 20 10:46:20 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5419A37B401 for ; Fri, 20 Sep 2002 10:46:19 -0700 (PDT) Received: from grant.org (grant.org [206.190.164.98]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F50C43E75 for ; Fri, 20 Sep 2002 10:46:18 -0700 (PDT) (envelope-from mgrant@splat.grant.org) Received: from splat.grant.org (mgrant@splat.grant.org [213.39.2.177]) by grant.org (8.12.3/8.12.3) with ESMTP id g8KHkEDC060739 for ; Fri, 20 Sep 2002 13:46:16 -0400 (EDT) (envelope-from mgrant@splat.grant.org) Received: (from mgrant@localhost) by splat.grant.org (8.11.6+Sun/8.11.6) id g8KHjZ521770; Fri, 20 Sep 2002 19:45:36 +0200 (MEST) Date: Fri, 20 Sep 2002 19:45:36 +0200 (MEST) Message-Id: <200209201745.g8KHjZ521770@splat.grant.org> From: Michael Grant To: freebsd-questions@freebsd.org Subject: automating backups of files Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I'd like to write something to automatically backup files as they change on disk. Perhaps not every byte, but say at reasonable intervals and especially when a file is closed. Does anyone know of any way I could get an indication in a userland process when an arbitrary file has been opened, closed, or modified? I can imagine a special device which I read which just feed me things like: /foo/bar modified /bar/baz close Before everyone bombards me with comments that I'm being completely stupid, I have my reasons for wanting to do this rather than using RAID to create a mirror. What I really want would certainly be best done if I were to write my own file system. But I don't have the time to do that right now. I've been looking long and hard for a sort of roll-back filesystem, but I've never seen this for unix. So, I'd like to create something somewhat close. What I want to do today is backup a file in many different states rather than just once per day. To do that, I need to know when the files change, rather than scanning through the entire file system constantly, hence my question. I realize that there's going to be some overhead to do this, but I suspect that the amount of overhead isn't going to be that much greater than say using RAID to mirror. Ideas and comments welcome... Michael Grant To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message