[Gloucs] ext4 file modification times too precise

Paul Broadhead lug at twinmoons.org.uk
Tue Jun 29 18:26:26 UTC 2010


Hi folks,

I recently reinstalled Ubuntu 10.04 as I have a new computer:) The
machine is now using ext4 file systems where the old machine used ext3
and the same OS.

I use a simple backup script which results in some tar.gz files being
copied to my server using a "cp -puvRf $source/* .", the important bit
is the -up options so that only changed files get copied, and copies
preserve the attributes of the original. The server, running Debian
5.0.5, is exporting the destination file system which is using ext3.

The problem is that it appears ext4 stores the modification time to a
larger precision than ext3, so for the copied files, the original
ext4 located file may have a stat modification time say:
Modify: 2010-06-27 07:57:27.622601087 +0100

The copy on the ext3 file system has:
Modify: 2010-06-27 07:57:27.000000000 +0100

This means that the -u part of the cp command thinks the original file
is always newer than the copy.  This means that each time by backup
runs, it copies over every file causing a lot of unnecessary network
traffic.

So having failed with google, is there a way to fix this without
changing file systems? Possibly with mount or export options? I have
added a hack to the backup script to touch the original file with the
time stamp from the copy. This fixes the problem but it is a hack!
-- 

Regards,
Paul




More information about the gloucs mailing list