cancel
Showing results for 
Search instead for 
Did you mean: 

Different jobfiles for Bash- and Redwood-scripts

Former Member
0 Kudos

Hello,

I have in a JobDefinition of type RedwoodScript a PostrunningAction which searches in stderr.log for a defined string:


import java.io.BufferedReader;
import java.io.FileReader;

import com.redwood.scheduler.api.model.JobFile;
{
  String errorSearch = "xxx";
  JobFile jf = jcsJob.getJobFileByName("stderr.log");

//zeilenweise lesen
BufferedReader in = null;
  in = new BufferedReader(new FileReader(jf.getFileName()));
  String zeile = null;
  while ((zeile = in.readLine()) != null && zeile.startsWith(errorSearch))
  {
    jcsOut.println(zeile);
  }
 
}

It is running fine.

If I insert this PostrunningAction to a JobDefintion of type Bash, it isn't working. Error message: No such file or directory.

In JobDefinition(Bash) the path of stderr.log is shown as


rdfs://server:1565/readFile?path=/usr/sap/sap-bpa/agent/x0d/var/SAP_X0D_09/server/jobs/5359/1094/JobFiles/stderr.log

In JobDefinition(Redwood) the path of stderr.log is shown as


/usr/sap/X0D/J09/j2ee/cluster/server0/scheduler/log/53580000-53589999/53589418/abc_53589418_2.log

What can I do that the jobfile will be found also in the JobDefinition(Bash)?

Best regards

Dana

Accepted Solutions (0)

Answers (1)

Answers (1)

gmblom
Active Contributor
0 Kudos

Hello,

The postrunning action always runs on the central server. But you can get access to the file content on the remote server as well.

use:

  1. BufferedReader in = null;  
  2.   in = new BufferedReader(new InputStreamReader(jf.getInputStream()));  

Regards Gerben

Former Member
0 Kudos

Hello Gerben,

it works fine, thanks!

Best regards

Dana