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

Function to determine if a file is older or newer than time

    XMLWordPrintable

    Details

      Description

      It would be nice to have a function that could tell me if a file was older or newer than a specific time.

      Currently, there are functions to tell if a file is newer or older than another file, or if the agent start time is before or after a given date.

      I can make promises about a file based on its age. I could use this to find out by copying a file with the stealth copy option, then promising to delete the file if its older than the time and defining a class as the result. I could promise to warn about deleting the file, but that would result in log spam.

      But I can not simply know if a file is newer or older than a time.

      Function Specification Ideas

      • file_older_than( path, epoch )
      • file_newer_than( path, epoch )

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel