[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Making tar not change ctime or atime



On Thu, Jul 25, 2002 at 12:33:25PM -0400, Mike Dresser wrote:
| On Thu, 25 Jul 2002, Sean 'Shaleh' Perry wrote:
|
| >        The  field  st_ctime  is  changed by writing or by setting
| >        inode information (i.e., owner, group, link  count,  mode,
| >        etc.).
| >
| > so simply doing a chmod will set ctime.
|
| I want tar to NOT change the ctime :)

Then don't change the inode.  That is, don't run tar or chmod or touch
or anything else that will change the inode.


Going back to the original post :

    I can get tar to not change the atime on a backup with the
    --atime-preserve flag.

    However, that makes it change the ctime, to do that.

Indeed, setting the atime field requires changing the inode.  Hence
ctime is changed.

The manpage shaleh quoted is stat(2).  Another section of it says :
    time_t  st_ctime;    /* time of last change */

You can't control it, which is a Good Thing.

-D

-- 
Your beauty should not come from outward adornment, such as braided hair
and the wearing of gold jewelry and fine clothes.  Instead, it should be
that of your inner self, the unfading beauty of a gentle and quiet
spirit, which is of GREAT WORTH in God's sight.  For this is the way the
holy women of the past used to make themselves beautiful.
        I Peter 3:3-5
 
http://dman.ddts.net/~dman/

Attachment: pgpX57f5KX1j7.pgp
Description: PGP signature


Reply to: