crontab
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   marco_baroetto
Posted On:   Monday, March 10, 2003 01:23 AM

Hi, I have a java application executed by a shell script:

it sets the environment and then run the app. It's a

simple app that parse a txt file and split it in several

files. When i run the script from the shell the

application works well. But I have to run it periodically

so I use crontab to schedulate it..

The problem is: when crontab run the script the

application has problem writing the new files and it

mistakes to write some special chars like ° or à è ...

Anyone has some ideas?

thanks, Marco

Re: crontab

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, March 10, 2003 06:49 AM

Maybe there are some environment variable you set in your interactive login shell, but not when your shell is invoked from the crontab. You'll have to check (print out, from the shell) all the environment and shell variables and see which ones are different.

Re: crontab

Posted By:   marco_baroetto  
Posted On:   Monday, March 10, 2003 01:56 AM

P.S. My method that copy the file is like this:


public void copyFile(String sourceD,String fileN,String destD){
DataOutputStream out;
BufferedReader inr;
String s;
boolean eof=false;
File destDir = new File(destD);



try{
if (!destDir.exists()) destDir.mkdir();
out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(destD+"/" + System.currentTimeMillis() +fileN,false)));
inr = new BufferedReader(new FileReader(sourceD+fileN));

while (!eof){
s=inr.readLine();
if (s!=null){
out.writeBytes(s+"
");
}
else eof=true;
}
inr.close();
out.close();
//new File(sourceD+fileN).delete();
} catch (IOException ioe) {
log.fatal(ioe.getMessage());
}
}
About | Sitemap | Contact