Hello,
I would like to copy the folders /etc/cron* and its contents to
another location. However, I still end up copying the whole /etc
directory.
Well, this should be feasible :)
bundle agent copyLocalFolder
{
files:
"/tmp/test/create_folder1/copy_local_folder"
comment => "copy local folder",
preserve => "true",
depth_search => allofit("99999999999"),
exclude_dirs => { "*" },
include_dirs => { "cron" },
copy_from => myLocalCopy("/etc/.");
}
Looks wrong to me. Have a look at
http://www.cfengine.org/manuals/cf3-reference.html#Pattern-matching-and-referencing
The thing is you are using shell-type pattern * instead of
perl-compatible ones .*
Also this stanza looks pretty valid as to copy /etc directory to
/tmp/.../copy_local_folder. Did you mean to put something like /etc/cron.*?
For depth_search you can use "inf", it's much better than specifying any
constant integer.
body depth_search allofit(d)
{
depth => "$(d)";
}
body copy_from myLocalCopy(from)
{
source => "$(from)";
}"
I saw you included cfengine_stdlib.cf. You can actually use
recurse(depth) and local_cp(from) body from there instead of rewriting
your own.
Best regards,
B
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine