Deleting old log files across multiple servers - Adobe Campaign Classic On Premise | Community
Skip to main content
Ken_Qrious
Level 4
September 28, 2020
Solved

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

  • September 28, 2020
  • 1 reply
  • 1501 views

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();
}
}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by prasannakumarmarru

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-configurations/configuring-campaign-server.html#high-availability-workflows-and-affinities

 

Thanks!

1 reply

prasannakumarmarru
prasannakumarmarruAccepted solution
Level 4
September 30, 2020

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-configurations/configuring-campaign-server.html#high-availability-workflows-and-affinities

 

Thanks!

Ken_Qrious
Level 4
October 1, 2020
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.