KB Article #177476
7ZIP archiving script correction for Integrator Archiver Task
Problem
-- When using an archiving script based on 7-ZIP for the Archiver task in Integrator, the archives are not created properly (the script does not create the subdirectories' structure inside the archive).
Resolution
* In order for the system to create the correct path towards the archived files, in the script there has to be a way to create the path. This is done by providing the files to be archived in a list.
Here is an example of script that works on Windows with 7-ZIP:
@echo off
for /F "tokens=2" %%T in ('Date /T') do (set DATE=%%T)
for /F "delims=/ tokens=1" %%T in ("%DATE%") do (set DAY=%%T)
for /F "delims=/ tokens=2" %%T in ("%DATE%") do (set MONTH=%%T)
for /F "delims=/ tokens=3" %%T in ("%DATE%") do (set YEAR=%%T)
set ARCHIVER="path_to_location_of_7z.exe"
cd /d C:\ <------- Here should be the drive where the Integrator is installed
del intarcfiles.lst
for /f "delims=\ tokens=1*" %%F in (%1) do echo %%G >> intarcfiles.lst
set ARCHIVE=%CORE_DATA%\%YEAR%-%MONTH%-%DAY%.zip
%ARCHIVER% a %ARCHIVE% @intarcfiles.lst
del intarcfiles.lst <----- This instruction is doubled just for safety reasons and will cause a warning when pressing "Test Script" in the Archiver Task's configuration
PLEASE NOTE THAT THIS ONLY APPLIES TO THE 7-ZIP ARCHIVER.