On Sun, Mar 13, 2011 at 07:13:33 -0700, Dan McDaniel wrote: > Just to point out that rsync v2.6.4 is pretty old. Current is 3.0.7. > Even my Debian Lenny system (Lenny was released two years ago) is > running 3.0.3. Perhaps there was a change in rsync's behavior since > 2.6.4. Version 3.0.7 does not change the access times on my system.
This is getting a bit off topic for this list, but just to wrap up the thread: I liked your theory that rsync's behavior had changed in later versions, but after fairly extensive searching through the "news" files for the program I wasn't able to find any mention of such a change (though I did find a mention of better atime-management in the "rsync3.txt" wish-list...). So I did some additional testing on an Ubuntu Lucid system, and those tests confirmed that rsync v3.0.7 DOES still set the atime for the source file (with or without the "-t" option) -- when used on a filesystem that has "normal" atime behavior enabled. However, I also noticed that on Lucid's kernel, filesystems are mounted by default with the "relatime" option turned on, which means that atimes are NOT updated in the usual sorts of "quick test of rsync" case (i.e. when you view a file and then try copying it with rsync). In other words, in order to see that rsync was updating the atime of the source file, I had to specifically use the "strictatime" mount option. I discovered that this kernel default was changed as of Linux v2.6.30; for more information on the change, you can search for occurrences of "relatime" in: http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.30 So I'm guessing that whatever system you have with rsync 3.0.7 also has a new enough kernel that the relatime change explains the results of your tests.... (I've include a transcript of my tests below.) Nathan ==> general info: # rsync --version | head -1 rsync version 3.0.7 protocol version 30 # uname -rvmo 2.6.32-28-server #55-Ubuntu SMP Mon Jan 10 23:57:16 UTC 2011 x86_64 GNU/Linux ==> set up a few aliases to use later # alias now='echo -n "[$(date +%T)]: "' # alias ftimes='stat -c "File: %N atime: %x mtime: %y ctime: %z "' ==> mount a filesystem with default mount options: # mount /root/temp_ext4.img /mnt -oloop # cd /mnt ==> create a file, then access the file, and check the file times: # now; rm -f atime.test*; echo "hello" > atime.test; ftimes atime.test [10:27:05]: File: `atime.test' atime: 2011-03-15 10:27:05.000000000 -0400 mtime: 2011-03-15 10:27:05.000000000 -0400 ctime: 2011-03-15 10:27:05.000000000 -0400 # sleep 5; now; cat atime.test; ftimes atime.test [10:27:11]: hello File: `atime.test' atime: 2011-03-15 10:27:11.000000000 -0400 mtime: 2011-03-15 10:27:05.000000000 -0400 ctime: 2011-03-15 10:27:05.000000000 -0400 ==> run rsync, then check the file times # now; rsync -v atime.test atime.test_rsync [10:29:06]: atime.test sent 80 bytes received 31 bytes 222.00 bytes/sec total size is 6 speedup is 0.05 # ftimes atime.test* File: `atime.test' atime: 2011-03-15 10:27:11.000000000 -0400 mtime: 2011-03-15 10:27:05.000000000 -0400 ctime: 2011-03-15 10:27:05.000000000 -0400 File: `atime.test_rsync' atime: 2011-03-15 10:29:06.000000000 -0400 mtime: 2011-03-15 10:29:06.000000000 -0400 ctime: 2011-03-15 10:29:06.000000000 -0400 # now; rsync -v -t atime.test atime.test_rsync-t [10:37:47]: atime.test sent 80 bytes received 31 bytes 222.00 bytes/sec total size is 6 speedup is 0.05 # ftimes atime.test* File: `atime.test' atime: 2011-03-15 10:27:11.000000000 -0400 mtime: 2011-03-15 10:27:05.000000000 -0400 ctime: 2011-03-15 10:27:05.000000000 -0400 File: `atime.test_rsync' atime: 2011-03-15 10:29:06.000000000 -0400 mtime: 2011-03-15 10:29:06.000000000 -0400 ctime: 2011-03-15 10:29:06.000000000 -0400 File: `atime.test_rsync-t' atime: 2011-03-15 10:37:47.000000000 -0400 mtime: 2011-03-15 10:27:05.000000000 -0400 ctime: 2011-03-15 10:37:47.000000000 -0400 ==> So, the atime of source file was not changed by either "rsync"... # now; cat atime.test; ftimes atime.test [10:38:43]: hello File: `atime.test' atime: 2011-03-15 10:27:11.000000000 -0400 mtime: 2011-03-15 10:27:05.000000000 -0400 ctime: 2011-03-15 10:27:05.000000000 -0400 ==> ... but then again, using "cat" again didn't update atime, either... # grep /mnt /proc/mounts /dev/loop0 /mnt ext4 rw,relatime,barrier=1,data=writeback 0 0 ==> because the volume is mounted with 'relatime" by default (though since it's the default, that doesn't show up in the output of "mount"): # mount | grep /mnt /dev/loop0 on /mnt type ext4 (rw) ==> now, switch the mount to use "strictatime" # mount /root/temp_ext4.img /mnt -oremount,strictatime # grep /mnt /proc/mounts /dev/loop0 /mnt ext4 rw,barrier=1,data=writeback 0 0 # mount | grep /mnt /dev/loop0 on /mnt type ext4 (rw,strictatime) ==> then repeat the tests: # now; rm -f atime.test*; echo "hello" > atime.test; ftimes atime.test [10:42:54]: File: `atime.test' atime: 2011-03-15 10:42:54.000000000 -0400 mtime: 2011-03-15 10:42:54.000000000 -0400 ctime: 2011-03-15 10:42:54.000000000 -0400 # sleep 5; now; cat atime.test; ftimes atime.test [10:43:00]: hello File: `atime.test' atime: 2011-03-15 10:43:00.000000000 -0400 mtime: 2011-03-15 10:42:54.000000000 -0400 ctime: 2011-03-15 10:42:54.000000000 -0400 # now; rsync -v atime.test atime.test_rsync [10:43:25]: atime.test sent 80 bytes received 31 bytes 222.00 bytes/sec total size is 6 speedup is 0.05 # ftimes atime.test* File: `atime.test' atime: 2011-03-15 10:43:25.000000000 -0400 mtime: 2011-03-15 10:42:54.000000000 -0400 ctime: 2011-03-15 10:42:54.000000000 -0400 File: `atime.test_rsync' atime: 2011-03-15 10:43:25.000000000 -0400 mtime: 2011-03-15 10:43:25.000000000 -0400 ctime: 2011-03-15 10:43:25.000000000 -0400 # now; rsync -v -t atime.test atime.test_rsync-t [10:44:03]: atime.test sent 80 bytes received 31 bytes 222.00 bytes/sec total size is 6 speedup is 0.05 # ftimes atime.test* File: `atime.test' atime: 2011-03-15 10:44:03.000000000 -0400 mtime: 2011-03-15 10:42:54.000000000 -0400 ctime: 2011-03-15 10:42:54.000000000 -0400 File: `atime.test_rsync' atime: 2011-03-15 10:43:25.000000000 -0400 mtime: 2011-03-15 10:43:25.000000000 -0400 ctime: 2011-03-15 10:43:25.000000000 -0400 File: `atime.test_rsync-t' atime: 2011-03-15 10:44:03.000000000 -0400 mtime: 2011-03-15 10:42:54.000000000 -0400 ctime: 2011-03-15 10:44:03.000000000 -0400 ==> with strictatime set, both "rsync" commands did update the atime on the source file....