Programming an Archive Compress Task - VisualCron - Forum

Community forum

Welcome Guest! To enable all features please Login or Register.



Go to last post Go to first unread
Offline tom_v  
#1 Posted : Thursday, April 26, 2018 9:58:02 AM(UTC)

Rank: No customer

Joined: 2/19/2018(UTC)
Posts: 2
Location: Berlin, Berlin

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:

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
Offline Support  
#2 Posted : Thursday, April 26, 2018 6:24:20 PM(UTC)

Rank: Official support

Joined: 2/23/2008(UTC)
Posts: 11,249

Thanks: 877 times
Was thanked: 449 time(s) in 426 post(s)
What error do you get?
Please like VisualCron on facebook!
Users browsing this topic
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Scroll to Top