PLEASE NOTE: With the release of Kiwi Syslog Daemon 8.3 a new Scheduler has been introduced which replaces the old archiving functionality and no long requires the use of the procedure listed below. If you now use v8.3 or above and have upgraded from an earlier version that was previously using the following procedure then you should disable it and use the built-in zipping functions of the archive task.
Kiwi Syslog Daemon currently utilizes the DartZip ActiveX component for it's log archiving. Under some circumstances, such as archiving files larger than 500MB, or archiving multiple log files per archive; Kiwi Syslog Daemon's log archiving behaviour can become unreliable.
The following article describes how to use an alternate third party command-line archiving utility, to provide more reliable log archiving in Kiwi Syslog Daemon. There are a number of third-party command-line archiving utilities currently available, but for the purposes of this article, we will be referring to the 7-Zip high compression-ratio file archiver. 7-Zip is free software distributed under the GNU LGPL, for more information and free download see: http://www.7-zip.org/
- Make a folder called C:Program FilesSyslogdPreZip
- Make a folder called C:Program FilesSyslogdZipped
- Create a batch file called ZipBatch.bat in the C:Program filesSyslogd folder
Ensure that ZipBatch.bat contains the following...
"C:Program files7-zip7z.exe" a -tzip "C:Program filesSyslogdZippedLogFiles-%1.zip" "C:Program filesSyslogdPreZip*.txt"
If Not ErrorLevel 1 Goto DeleteFiles:
Echo ***SERIOUS ERROR DETECTED***
Goto Exit:
:DeleteFiles
Del /Q "C:Program filesSyslogdPreZip*.txt"
:Exit
This batch file calls the 7-Zip command line application (7z.exe) and will zip all the *.txt files found in the PreZip folder. The created zip file will be called "LogFiles-" + CurrentDateStamp.zip. (the datestamp is passed as %1 from Kiwi Syslog Daemon via the command line argument.)
-
If there is no error returned from the zipping call, the batch file will then delete the log files in the PreZip folder. If there is an error in the zipping, it will not delete the log files.
- Create an Archive schedule in the Kiwi Syslog Daemon | Setup menu to move the files from the Logs subfolder to the PreZip subfolder.
- Hourly or Daily schedule.
- Source folder: C:Program filesSyslogdLogs
- Destination folder: C:Program filesSyslogdPreZip
- Choose the "Use dated file names" option
- Set Date format to: YYYY-MM-DD-HH-NN-SS (This will ensure that all moved files are unique)
- Check the "Run program after move" option
- File to run: "C:Program FilesSyslogdZipBatch.bat"
- Command line: %DateStamp
- Uncheck the "Zip files after archiving"
