[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: action copy options
From: |
Ted Zlatanov |
Subject: |
Re: action copy options |
Date: |
Tue, 23 Jul 2002 10:51:31 -0400 |
User-agent: |
Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386-redhat-linux-gnu) |
On Tue, 23 Jul 2002, slautier@lavache.com wrote:
> I would like cfengine to copy files hostname.* from the server to
> the directory /etc on the client side. But I also would like it to
> remove files which exist on the client side but not on the server
> side.
>
> Example:
> --------------------------------------------
> **Before running cfengine
> server side client side
> hostname.eri0 hostname.eri0
> hostname.qfe0
> toto
> tutu
>
> **After having runned cfengine
> server side client side
> hostname.eri0 hostname.eri0
> toto
> tutu
> --------------------------------------------
>
> I've tried the following with the purge option set to yes:
> --------------------------------------------
> copy:
> <cfengine_root>/network dest=/etc
> r=1
> include=hostname.*
> purge=true
> server=<server_name>
> --------------------------------------------
>
> But this gives the following result:
> --------------------------------------------
> server side client side
> hostname.eri0 hostname.eri0
> --------------------------------------------
> It removes all files which are not hostname.eri0... the thing is
> that I don't want files toto and tutu to be removed.
Your problem is that you want to delete only some files on the client
side, and cfengine has no way of specifying that easily. I would
mirror to a separate directory, e.g. /etc/hostnames, and then do
"/bin/rm /etc/hostname.* ; /bin/cp /etc/hostnames/* /etc"
(assuming /etc/hostname.* come only from the server)
Hope that helps
Ted