atime, tar and rsync

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Kevin Buettner
Date:  
Subject: atime, tar and rsync
On Sep 11, 3:08pm, Bill Warner wrote:

> While doing some looking around on some of our production servers I was
> noticing that all files are accessed pretty much every day. I know that
> many of the files are not used by anybody, Does tar or rsync (both used
> in parts of backups) moddify the atime? what else might modify the
> atime on a standard setup. perhaps updatedb? Is there any way to get
> system programs to not change the atime whenever they are just
> catologing or backing up files?


The only idea that I had was to use "mount -o noatime --bind dir backupdir"
and then have your backup scripts access backupdir. I just tried it
out though and it doesn't work. The mount operation succeeds, the
"--bind" part of it works okay, but files accessed in the "backupdir"
hierarchy have their atimes modified.

If you can afford to kick everyone off of the machines, you could, of
course, unmount and then remount the directories in question with -o
noatime prior to doing the backup.

It may also be possible to mount the raw device more than once with
different options, but that's not something I want to try. I'm not
convinced that the file metadata would be sync'd properly.

Hmm... I wonder if the --bind trick could be made to work in the
other direction? I.e, do all mounts with "-o noatime" at system
startup time to a hierarchy that only backup scripts will access.
(They could even chroot there if they wanted to). Then use "-o atime
--bind" options to make all the other mounts (/usr, /home, etc) via
the "backup" hierarchy. I have no idea if this'll work. If you try
it, let me know how it goes...

Kevin