Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-3275

Configure where file change information is stored

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 3.15.0
    • Fix Version/s: None
    • Labels:
      None

      Description

      Since it is not allowed to recursively monitor files for change, if you want to monitor a directory recursively, you must first enumerate the list of files that you want to monitor.

      Requiring storage of file change information to be next to the monitored file can result in an explosion of unwanted _cfchanges and .cfsaved suffixed files.

      bundle agent example_observe_file_changes_recursively
      {
      
        vars:
          "my_files"
            slist => findfiles( "/tmp/detect_changes/**" );
      
        files:
            "$(my_files)"
              create => "false",
              changes => diff,
              classes => results( "bundle", "$(this.promiser)_detect_change" );
        reports:
          "$(my_files)";
          "$(with)" with => join( "$(const.n)", classesmatching( ".*_detect_change_.*:" ) );
      }
      bundle agent __main__
      {
        methods: "example_observe_file_changes_recursively";
      }
      
        notice: Storing sha256 hash for '/tmp/detect_changes/root' (SHA=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
      R: /tmp/detect_changes/root
      R: 
        notice: Storing sha256 hash for '/tmp/detect_changes/root_cfchanges' (SHA=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
      R: /tmp/detect_changes/root_cfchanges
        notice: Storing sha256 hash for '/tmp/detect_changes/root_cfchanges_cfchanges' (SHA=e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855)
      R: /tmp/detect_changes/root_cfchanges_cfchanges
      • Would it make more sense to store these _cfchagnes files in a tree under sys.statedir?

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            a10042 Nick Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: