Cfengine configuration directory

Copying files from many nodes to one (aggregation or collection)

Relevant classes: any

Suppose you have a centralized "master server" and you want to collect from all of the other clients a file.

  • You need to run cfservd on every client.
  • Use a cfagent.conf entry on the master like this to collect a file from the list. We use list iteration to accomplish this.
    
    control:
    
     actionsequence = ( copy )
    
     list = ( aaaaa:bbbbbb:ccccccc:dddddd )
    
    # Or..
    #
    # list = ( SelectPartitionNeighbours(/home/mark/tmp/cfrun.hosts,#,random,4) )
    #
    
    copy:
    
      /var/cfengine/database dest=/tmp/$(this)/filename server=$(list)
    
    

Notice that the special variable $(this) holds the value of the current server during iterations.

Back to documentation