[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
using filters when copying single files
From: |
Hans Kowallik |
Subject: |
using filters when copying single files |
Date: |
Tue, 16 Jul 2002 15:07:49 +0200 |
Hi!
It's not a bug, more a suggestion.
Currently cfengine does use the filter=
feature when I want to copy a single
file, it only works for recursive copies
(RecursiveImage).
The reason I want that filter is the
following scenario:
if file does not exist copy it from the
remote server
if file differs from the master file on
the server issue a warning
filters:
{ does_not_exist
Type: "reg"
Result: "!Type"
}
copy:
$(cf_depot)/tmp/hello dest=/tmp/hello
filter=does_not_exist server=cf_master
$(cf_depot)/tmp/hello dest=/tmp/hello
backup=false type=checksum action=warn
server=cf_master
After adding:
623,633d622
<
< /* HANS modification - allow filters
not only for recursive
< copies but for single files as well */
<
< lstat(destfile,&deststatbuf);
< if
(!FileObjectFilter(destfile,&deststatbuf,ip->filters,image))
< {
< return;
< }
<
< /* END of HANS modification */
into image.c (cfengine-1.6.3, ImageCopy)
this seems to work
I have no idea, if other people have a
need for this, but here this is
extremely helpful.
Hans Kowallik
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- using filters when copying single files,
Hans Kowallik <=