SUMMARY: cron job won't run (part 2)

From: Bill Bergman <wrb_at_wcsmail.com>
Date: Fri, 18 Apr 1997 14:23:26 -0400

Thanks to:

Hans Ranke <Hans.Ranke_at_Regent.E-Technik.TU-Muenchen.DE>
Karl Marble <marblek_at_ci.worcester.ma.us>
Pirie Hart <pirie_at_u.washington.edu>

At the suggestion of Hans I ran ls -lc /var/adm/syslog.dated with the
following results:

# ls -lc /var/adm/syslog.dated
total 64
drwxr-xr-x 2 root adm 8192 Apr 18 04:30 12-Apr-18:23
drwxr-xr-x 2 root adm 8192 Apr 18 04:30 13-Apr-00:14
drwxr-xr-x 2 root adm 8192 Apr 18 04:30 14-Apr-00:14
drwxr-xr-x 2 root adm 8192 Apr 18 04:30 15-Apr-00:14
drwxr-xr-x 2 root adm 8192 Apr 18 04:31 16-Apr-00:14
drwxr-xr-x 2 root adm 8192 Apr 18 04:31 17-Apr-00:14
drwxr-xr-x 2 root adm 8192 Apr 18 04:31 17-Apr-07:02
drwxr-xr-x 2 root adm 8192 Apr 18 07:02 18-Apr-07:02

It turns out that there is a cron job backing up /var/adm/syslog.dated each
night. That job causes the ctime to be modified but does not change the
mtime. Therefore, the -ctime expression never evaluates as true (ctime is
never older than 5 days) so the directories are never deleted. I am going
to include all 3 replies because each is well thought out and offers some
insight into this question.

=============================
>From Hans Ranke

Try doing ls -lc /var/adm/syslog.dated to show the ctimes.

Perhaps you have another cron job trying chown or to chmod the directories.
This will update the ctimes, but not the mtimes.


=============================
>From Karl Marble

The -ctime part of find has never worked for me, or has yielded
inconsistent and unreliable results. Backups also modify access times, so
-mtime was the only one that worked. If you're using AdvFS, you can
preserve access times by cloning the fileset and then backing up from the
clone.

=============================
>From Pirie Hart

The difference between the two options is subtle. -ctime uses file inode
changes; -mtime uses file changes. The inode is the internal structure
that describes the individual files in the operating system. There is one
inode for each file. An inode contains the mode, type, owner, and
location of a file. Thus, if the owner or mode or location changes, the
inode changes but the file remains unchanged.






Bill Bergman
Westinghouse Communications
(412) 247-6206
wrb_at_wcsmail.com
Received on Fri Apr 18 1997 - 20:32:28 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:36 NZDT