[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ctime vs checksum in copies
From: |
Ed Brown |
Subject: |
Re: ctime vs checksum in copies |
Date: |
Wed, 30 Nov 2005 15:43:51 -0700 |
One more approach, that doesn't require any file copying or tempfile
storage, is to build the file entirely with cfengine, like this yum.conf
example, where 3 variables are set depending on network segment, server
class, and whether it's a 'new build' or not:
{ /etc/yum.conf
EmptyEntireFilePlease
AppendIfNoSuchLine "[main]"
AppendIfNoSuchLine "cachedir=/var/cache/yum"
AppendIfNoSuchLine "pkgpolicy=newest"
AppendIfNoSuchLine "tolerant=1"
AppendIfNoSuchLine "exactarch=1"
AppendIfNoSuchLine "retries=3"
AppendIfNoSuchLine "exclude=${YumExcludes}"
AppendIfNoSuchLine "${LogString}"
AppendIfNoSuchLine "[base]"
AppendIfNoSuchLine "name=${packageserver} common rpm
repository"
AppendIfNoSuchLine "baseurl=ftp://${packageserver}"
AutoCreate
}
As with some of the other examples, cfengine doesn't actually rewrite
the file unless it's necessary. This is well-suited for short files,
would be a little bit of a pain to generate long files this way.
-Ed