Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

Deleting old log files across multiple servers - Adobe Campaign Classic On Premise

Avatar

Level 4

I have successfully created a technical work flow (with java script) which removes old log files from our unix servers but cannot see a way to specify which host to navigate.  The result is that for production which has 4 servers (2 web and 2 marketing) the process will only run on the first marketing server it sees even if the path and instance exist on more than one of the servers.  

 

Is there a way to specify the host?

 

var strFolderPath = "/appl/adobe/nl6/var/prod_instance/export";
var strPattern = "*_exportList.csv";
var intRetentionDays = 120;
var objDirectory = new File(strFolderPath)
var objFiles = objDirectory.list(strPattern)
logInfo("Search Criteria file count " + strFolderPath + strPattern + " is : " + objFiles.length)

var dateOffset = (24*60*60*1000) * intRetentionDays;
var checkDate = new Date();
checkDate.setTime(checkDate.getTime() - dateOffset);
logInfo("Delete " + strFolderPath + strPattern + " files where last modified date < " + checkDate.toString());

for each(var objFile in objFiles)
{
if (objFile.lastModified < checkDate) {
logInfo("Deleting file: " + strFolderPath + objFile.name + " - last modified at " + objFile.lastModified);
objFile.remove();
}
}

1 Accepted Solution

Avatar

Correct answer by
Level 5

Hi Ken,

In order to do any operation on a host, you need to run the workflow on that particular host. And you need to have wfserver running on that particular host, If you are having wfserver running on an instance, you can specify affinity to select host on which you want to run the workflow. Which means you may have to create four different workflows with four different affinities(each one from a server) and run.

 

Use the below doc for more info- https://docs.adobe.com/content/help/en/campaign-classic/using/installing-campaign-classic/additional...

 

Thanks!

View solution in original post

2 Replies

Avatar

Correct answer by
Level 5

Hi Ken,

In order to do any operation on a host, you need to run the workflow on that particular host. And you need to have wfserver running on that particular host, If you are having wfserver running on an instance, you can specify affinity to select host on which you want to run the workflow. Which means you may have to create four different workflows with four different affinities(each one from a server) and run.

 

Use the below doc for more info- https://docs.adobe.com/content/help/en/campaign-classic/using/installing-campaign-classic/additional...

 

Thanks!

Avatar

Level 4
I did see something about this when I was investigating but wasn't certain if this approach was the right solution. It's good to see confirmation, I'll try it.