[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Testing for file age
From: |
David E. Nelson |
Subject: |
Re: Testing for file age |
Date: |
Mon, 13 Feb 2006 10:01:50 -0600 (CST) |
Hi John,
Hmmm, good question. 'tidy:' seems to be the only fuction that uses 'age='.
So, how about this: go ahead and delete slocate.db since it is going to be
rebuilt in a matter of minutes anyways? Your users may balk at this if they
use 'locate' very regularly 24x7.
tidy:
any.Hr02:: # Update slocate.db at 2AM if older than 4 days.
/var/lib/slocate
pattern=slocate.db
age=4
type=mtime # access time is used by default
define=run_updatedb
shellcommands:
any.run_updatedb::
"/usr/bin/updatedb"
- or -
Hmmm, I can't get filters -> FromMtime to work (2.1.14). But this might an
option, too.
Good luck,
/\/elson
On Mon, 13 Feb 2006, John van Zantvoort wrote:
Hi,
I'd like to test for a files mtime to define a class so if e.g. the
/var/lib/slocate/slocate.db file is more then 4 days of define the class
run_updatedb. but I've not been able to find such a function within
cfengine.
Any hints?
--
Met vriendelijke groeten/with kind regards
John van Zantvoort
---
Paranoia is simply an optimistic outlook on life.
GCM d- s+:+ a- C+ UL+++ P+++ L++ E--- W++ N+ o K-
w-- O- M- V- PS+ PE- Y+ PGP+ t+ 5 X- R- tv b+ DI++
D+ G e h- r++ y+
--
~~ ** ~~ If you don't think too well, then don't think too much. ~~ ** ~~