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