Forum: CFEngine Help
Subject: Re: Clarification on parameter passing with bundles / classes
Author: lauwersw
Link to topic: https://cfengine.com/forum/read.php?3,24247,24254#msg-24254
Try to strip down your code. Your first problem definitely works for me in a
stripped down version with cfengien 3.2.3, calling a second bundle as many
times as required. I also agree with toddnni for your second problem.
Depending on your exact requirements, cfengine definitely has the capability to
exactly sync directories via the "purge" option.in "body copy_from". Check the
COPBL for sync_cp. It only works though if your base directory remains the
same. For example if you want to copy to a directory /opt/program and only the
contents below "program" change, no problem. But if you want to copy
/opt/program-version and "version" changes every time, it won't work as it will
erase everything else under /opt too...
You can even work around that by copying in multiple stages, using depth_search
=> recurse("1") and a combination of "ls" and methods, but that can get really
convoluted. Let me know if you do want to go that way, I have done that in some
specific instances so I can share some code.
On the other hand recursive copy is not always desirable, depending on the size
and the number of files/subdirs in the tree you want to copy, but I guess
that's obvious.
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine