Is there a way to use AF to determine the oldest data archive being stored and return the time stamp (file creation date) to determine if we are keeping the required legal archives?
Have you taken a look at Oldest tag value available on PI server ?
Something like NextEvent('tag','1-jan-1970') as an analysis could indicate the last archived value for a tag.
How do I determine which of my 80,000 tags has the oldest value? All of our archives sit out on the E:\ drive, and then also out on a F:\ drive. theoretically, the E:\ drive is supposed to keep around 3 years of active archives, and the F:\ drive to archive around 5-7 years (yet to be determined). To comply with data retention regulation (especially environmental), the idea would be for AF to find the oldest file date and report that up on an automated report every so often (todays date - oldest file date) = x years
What about using Powershell to write the result in a file and either updating the value of the PI Tag with PowerShell directly or using UFL Interface/Connector.
Something along the lines of:
$FirstDate = Get-ChildItem -path C:\PIArchives -file | Sort CreationTime | Select-Object -First 1
In theory, you need only to ask this question once unless you start purging data. So don't spend too much time on a solution. Or at least not in the next 4 years...
I'll figure out some way to do what I need.
Retrieving data ...