[SunHELP] Time and Date Stamp


Thu Apr 18 08:34:30 CDT 2002


Well the problem is not actually the time on the files...but the directory
they are held in.  The script removes all directories in /var/log/fullog
that are older than 40 days.  Within /var/log/fullog are dirs such as
Mar_2_2002, Mar_3_2002, etc.  When I uncompress the files in Mar_2_2002 on
the 10th for example the dir gets the date of the 10th.
The script now uses 'find -mtime +40'...should that be switched to ctime?
The man file says 'true is the file's status was changed n days ago' (ctime)
...I am not sure what 'status' means...that sounds more general that
mtime...do you know?

Thanks,

Shain



-----Original Message-----
From: Will Mc Donald [mailto:wmcdonald at ntlworld.com]
Sent: Thursday, April 18, 2002 8:48 AM
To: Miley, Shain
Subject: Re: [SunHELP] Time and Date Stamp


Are you removing old files based on atime (last access time) or ctime
(creation time)?

Looking at the man page for gzip...

-N --name
              When  compressing,  always  save  the  original  file name and
time stamp; this is the default. When decompressing, restore the original
file name and time stamp if present. This option is useful on systems which
have  a  limit  on file name length or when the time stamp has been lost
after a file transfer.  

And this is default behaviour. So I just tried this...

[wmcdonald at dev2 wmcdonald]$ ls -l pict001.wmf
-rw-r--r--   1 wmcdonal dev         27828 Oct 10  2001 pict001.wmf
[wmcdonald at dev2 wmcdonald]$ gzip pict001.wmf
[wmcdonald at dev2 wmcdonald]$ ls -l pict001.wmf.gz
-rw-r--r--   1 wmcdonal dev          4799 Oct 10  2001 pict001.wmf.gz
[wmcdonald at dev2 wmcdonald]$ gunzip pict001.wmf.gz
[wmcdonald at dev2 wmcdonald]$ ls -l pict001.wmf
-rw-r--r--   1 wmcdonal dev         27828 Oct 10  2001 pict001.wmf
[wmcdonald at dev2 wmcdonald]$

Now, admittedly this is on a linux box but I've checked on one of our (old)
Solaris boxes running gzip 1.2.4 and it supports that flag, though I don't
know if it's default behaviour. Actually, I've just checked and it appears
that it's default on the old version we built on that Solaris box. 

So, what are you doing to tell how old the files are?


----- Original Message ----- 
From: "Miley, Shain" <SMiley at czn.com>
To: <sunhelp at sunhelp.org>
Sent: Thursday, April 18, 2002 1:21 PM
Subject: [SunHELP] Time and Date Stamp


> Hi,
> I have a script that gzip's up some log files and then removes any older
> than 40 days.  My problem is when I go in to check some of the logs the
date
> stamp gets changed when I uncompress the files to look at them...is there
> any way to make sure that the date on this directory does not
> change...otherwise I have been using touch to reset the time/date but that
> is getting old really quick...thanks,



More information about the SunHELP mailing list