To my knowledge, the PI Data Archive does not have a built in feature to automatically delete archives older than a certain date. The closest thing to this feature would be disable automatic archive creation, and enable overwrite data on auto shift failure, the combination of which would stop the archive from creating new archives and would cause it to overwrite existing archives, starting from the oldest archive. If the automatic archive creation is left enabled then and the overwrite data is enabled, then the PI Data Archive will only overwrite older archives, if it fails to create a new archive to shift to. The following linked article goes into more detail about these tuning parameters, which can be found in PI System Management Tools (SMT) > Operation > Tuning Parameters > Archive: KB3122OSI8.
I would also like to add, that you could create a simple script to delete archives older than a certain date:
This would be possible with scripts (VBA scripts for example) or custom-written program, or perhaps 3rd party file-cleanup software.
- We do not have a such a script available, but the general logic of such a script would look something like this:
1) Query the archive folder for all file names (FileList = AllFiles("C:\PI\Archives")
2) Loop through each file for the “date modified”
(Something like this: ModifiedDate = IO.File.GetLastWriteTime(“FileList”))
3.) Unregister the files that are over 3 years old (piartool –au “file path”)
4.) Delete the file (My.Computer.FileSystem.DeleteFile("C:\test.txt"))