Programming an Archive Compress Task - VisualCron - Forum

Community forum

tom_v
  •  tom_v
  • No customer Topic Starter
2018-04-26T07:58:02Z
Hey Forum,

i hope you can help me with this Problem.
I want to Compress something.
I use C# for Programming my tasks.

I just dont know how the correct Code should look like.
I tried a FileFilterClass and a ArchiveItemClasse.

My Code looks like this:
Quote:


FileFilterClass ffc2 = new FileFilterClass();
ffc2.IncludeFileMask = "*.*";
ffc2.SourceFolder = "\\\\testserver\\c$\\Programs\\test\\test\\logs";
ffc2.Credential = vcds.thecreds["testuser"].Id;
ffc2.IncludeSubFolders = true;

ArchiveItemClass aic = new ArchiveItemClass();
aic.FileFilter = ffc2;
aic.ExistAction = EnumClass.ExistActionT.Append;

// Task 3 und 4 ausstehend
TaskClass task3 = job.AddTask(TaskClass.TaskT.ArchiveCompress);
task3.Name = "Test Log zippen und archivieren";
task3.ArchiveCompress.ArchiveType = TaskArchiveClass.ArchiveT.Zip;
task3.ArchiveCompress.ExistAction = EnumClass.ExistActionT.OverwriteIfNewer;
task3.ArchiveCompress.ArchivePath = "\\\\testserver\\logs\\Test_{DATENOWADD(Days|-1|dd.MM.yyyy HH_mm)}.zip";
task3.ArchiveCompress.CompressionLevel = TaskArchiveClass.CompressionLevelT.Normal;
task3.ArchiveCompress.ArchiveItems = aic;



I got an Error at the last Line.
I hope you can give me a hint.

Kind regards
Support
2018-04-26T16:24:20Z
What error do you get?
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top