[LogFiles] Archive

Q100006: [LogFiles] Archive

Archives files into .zip files, either to a folder of your choosing or to the same location as the source files. It then always deletes the original source files upon successfully completing archive step. Then can also optionally deletes any .zip files that are older than a specified threshold.

Parameter In/Out Description Other Info
File source InOut The file source is a list of one or more files such as a FileList from another module. A typical example being the FileList output parameter from the [Files] Find module.
Archive folder InOut The folder where the archived files will reside. (If left blank, the output files will be created in the same folder as the source files.
Compression grouping In Choices: None, Timestamp, Hour, Day, Week, Month, Quarter, Year
This determines how often the zip file is updated versus creating a new one. For instance, if Month is selected, the zip file will have the current month as part of its name (e.g., MyLogFiles_2025-01.zip for January 2025). Any time this module is executed during that month, that same zip file will be updated. If grouping of None is selected, each file is compressed into its own zip file, and the Compression File Prefix is ignored (e.g., logs-jan-2025.txt will be zipped to logs-jan-2025.txt.zip).
Default: None
Compressed file prefix In If Compression Grouping is selected, the zip filename is generated based on the file prefix and the grouping options. So a prefix such as ServerLogs with the grouping set to Month would result in all eligible files being added to a compressed file with the name ServerLogs_YYYY-MM.zip, where the values for YYYY and MM are set according to the run date. If grouping of None is selected, this parameter is ignored: each zip file is given the same name as the original file name, with .zip at the end.
Purge old archive files? In If this is selected, then after archiving of logfiles is completed, older logfiles in the Archive Folder exceeding a specified age will be deleted. Default: False
Purge age threshold value In If 'Purge Old Archive Files?' is selected, enter the integer age threshold value here. Default: 30
Purge age threshold units In Choices: Minutes, Hours, Days, Weeks, Months
If 'Purge Old Archive Files?' is selected, enter the units (Minutes, Hours, ...) for the age threshold value.
Default: Days
Log output level In Choices: Minimal, Verbose
The level of execution detail you want to appear in the log.
Default: Minimal
Source files archived Out The fully qualified pathnames of source files that were archived and deleted.
Old archive files purged Out The fully qualified pathnames of old archive files that were deleted.
File list Out The fully qualified pathnames of new compressed archive files that were generated.

(Italics = required parameters)

Notes

Designed to be used for a collection of log files that are constantly being created and updated, this module provide a great deal of flexibility in archiving them.

If you want one archive file per month, select Compression Grouping of Month. The module can be run every day, or even several times a day, but its output will go to the same file, named for the current month.

You might decide you want one file per day, but only keep archives for 90 days. In this case you would use these settings:

Parameter Value
Compression grouping Day
Purge old archive files? Yes
Purge age threshold value 90
Purge age threshold units Days

With this configuration, if there are multiple files generated with the same date, they would be grouped together by day in the compressed archive file that the module creates in the archive folder. Then when the compression/archiving pass is completed, the module looks in the specified archive folder and deletes any old archive files that exceed the specified age. So in this example, we would keep archive files for up to the last 90 days.

 
Last Updated:
10/3/2023 1:06:45 AM
JobServer.NET Knowledgebase © 2025