[Techtalk] find ctime after mtime

Meryll Larkin alwanza at oz.net
Sun Jun 22 19:39:41 UTC 2008


I was notified that the 15 gig harddrive was 90% full.  Why we would have a
15Gig HD escapes me except to say that it is Linux and the management puts
all their money into the Microsoft servers and then has little left over...
A legacy machine.  Running bricolage.

The webdev had written a backup shell (/bin/sh) script which was working
fine for months.  It ran on a daily cron job.  It backed up the web files
into a tar gzip format like so:

tar cfz  backupfile_with_date.tgz  /path/to/webfiles/

Then it deleted the old ones so that the tiny harddrive would not fill up.
The delete line was this:

find /home/webservice/backups/ -ctime +5 -exec rm -f {} \;

which looks perfectly good to me; but it had stopped working.  I don't know
why.  On deeper investigation I found that ctime was screwed up.  Changing
the line to:

find /home/webservice/backups/ -mtime +5 -exec rm -f {} \;
worked.  

I found this:
To see what the values of mtime, atime, ctime are use:
ls -lt   (mtime)
ls -lu   (atime)
ls -lc   (ctime)

and ctime was AFTER mtime.  Has anyone seen anything like this before or
should I suspect this might be a deeper (hardware?) issue?

thanks,
Meryll Larkin



More information about the Techtalk mailing list