Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Recursion Problem??

0 views
Skip to first unread message

Adam M. Dunn

unread,
Sep 8, 2004, 3:56:43 PM9/8/04
to help-c...@gnu.org

Anyone,

I'm running into a problem with the recursion option in a copy command.
For example, using the default model of copying the updated configs from:

server:/var/cfengine/masterfiles --> client:/var/cfengine/inputs

just as an example, and setting a recursion to r=0, nothing copies.
However, if I keep it at r=1, or r=inf, then everything copies, but I
don't want that. Basically I just want to copy only single files from a
source directory to the client and ignore any subdirectories, but it's not
letting me.

Is this common behavior, or am I doing something wrong?


Thanks,
Adam

David E. Nelson

unread,
Sep 8, 2004, 5:09:01 PM9/8/04
to Adam M. Dunn, help-c...@gnu.org

Hi Adam,

I just used/tried:

copy:

any::

/var/cfengine/master_inputs/foo # Specific file
dest=/tmp/bar # Specific file
r=0
mode=0600
backup=false
server=$(policyhost)

w/o any problems.

HTH,
/\/elson

> _______________________________________________
> Help-cfengine mailing list
> Help-c...@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine
>

--
~~ ** ~~ If you didn't learn anything when you broke it the 1st ~~ ** ~~
time, then break it again.


Ed Brown

unread,
Sep 8, 2004, 6:04:19 PM9/8/04
to Adam M. Dunn, help-c...@gnu.org
With a directory for a source/dest, and 'r=1', cfengine will create any
subdirectories in that top-level directory, but does not recurse into
them (they will be empty). If you don't want the subdirectory created,
try 'ignore=modules' (or whatever the subdirectory is that you don't
want created.)

-Ed

Adam M. Dunn

unread,
Sep 8, 2004, 6:20:19 PM9/8/04
to Ed Brown, help-c...@gnu.org

Yes, thanks. That ignore worked. It would be nice though if cfengine had
an option to treat files and directory names differently, such as an omit
directory option. I would much rather be able to create random sub
directories and not have them copied without specifying them explicitly.


thanks,

~adam

Adam M. Dunn

unread,
Sep 9, 2004, 11:36:23 AM9/9/04
to Mark Burgess, help-c...@gnu.org

GREAT!

I hadn't used filters before, but that worked great. I just setup a
filter to ignore directories and can now just call it from a files option:
filter=ignoredir. That's exactly what I was looking for.

filters:

{ ignoredir

Type: "dir"
Result: "!Type"

}


Thanks Mark!

~Adam


On Thu, 9 Sep 2004, Mark Burgess wrote:

>
> You could use a filter to do this,
>
> M

> --
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Work: +47 22453272 Email: Mark.B...@iu.hio.no
> Fax : +47 22453205 WWW : http://www.iu.hio.no/~mark
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>

0 new messages