Project

General

Profile

Problem with 'Cleanup' Attribute

Added by Singh Lokendra over 14 years ago

Hi all,

I am using JSAGA with SSH adaptor. It seems that the implementation of 'Cleanup' Attribute of JobDescription has some bug. It deletes the output file on the remote machine even when the Cleanup attribute is set to "false". In my application, I want it to remain on the remote machine after the job finishes. Any help?

Cheers
Lokendra Singh


Replies (7)

RE: Problem with 'Cleanup' Attribute - Added by Reynaud Sylvain over 14 years ago

Hi Lokendra,

Since the SSH adaptor currently does not cleanup anything, I guess this occurs only when you are using the FileTransfer attribute? If so, that bug is now fixed in the new snapshot (it was a bug in the JSAGA core engine).

Please note that the default behavior in this case will be to cleanup files, so you will have to explicitly set Cleanup attribute to 'false' to prevent them from being deleted.

Cheers,
Sylvain

RE: Problem with 'Cleanup' Attribute - Added by Singh Lokendra over 14 years ago

Dear Sylvain,

Yeah, the error occurs when the FileTransfer attribute is used. But, I am using the latest snapshot and still getting the error.
I downloaded the libs from http://grid.in2p3.fr/software/jsaga-dev/download.html.

Regards
Lokendra Singh

RE: Problem with 'Cleanup' Attribute - Added by Reynaud Sylvain over 14 years ago

Hi,

I am unable to get this error with this snapshot when I set Cleanup=false.

Can you please provide more info, such as the list of SAGA attributes set, the file paths...

Cheers,
Sylvain

RE: Problem with 'Cleanup' Attribute - Added by Singh Lokendra over 14 years ago

Hi Sylvain,

This is the snippet of my code.

URL serviceURL = URLFactory.createURL("ssh://localhost#SSH")

JobDescription desc = JobFactory.createJobDescription()
desc.setAttribute(JobDescription.EXECUTABLE, "groovy")
String[] arguments = ["test.groovy"]
desc.setVectorAttribute(JobDescription.ARGUMENTS, arguments)
desc.setAttribute(JobDescription.WORKINGDIRECTORY, "/tmp/jsagaTest")
desc.setAttribute(JobDescription.INTERACTIVE, "false") //turning the Batch mode
desc.setAttribute(JobDescription.OUTPUT, "output.txt");
desc.setAttribute(JobDescription.ERROR, "error.txt");
desc.setAttribute(JobDescription.CLEANUP,"false");
desc.setVectorAttribute(JobDescription.FILETRANSFER, (String [])['./test.groovy>sftp://localhost/tmp/jsagaTest/test.groovy#SSH','./output.txt<sftp://localhost/tmp/jsagaTest/output.txt#SSH']);

// create the job
Session session = SessionFactory.createSession(true)
JobService service = JobFactory.createJobService(session, serviceURL)
Job job = service.createJob(desc)
job.run()

RE: Problem with 'Cleanup' Attribute - Added by Reynaud Sylvain over 14 years ago

Can you try this?

cat << EOF > job.txt
Executable=/bin/pwd
WorkingDirectory=/tmp/worker
Interactive=false
Output=output.txt
Error=error.txt
Cleanup=false
FileTransfer=/tmp/client/result.txt<output.txt
EOF

mkdir /tmp/client /tmp/worker
jsaga-job-run -f job.txt -r ssh://localhost

RE: Problem with 'Cleanup' Attribute - Added by Singh Lokendra over 14 years ago

Hi Sylvain,

Your code tries to transfer the output.txt to a different directory on the remote machine. I tried that and it works, but still the output gets deleted from /tmp/worker/ even though Cleanup attribute is set to false.

Cheers
Lokendra Singh

RE: Problem with 'Cleanup' Attribute - Added by Reynaud Sylvain over 14 years ago

Hi,

You can not have this behavior with the latest snapshot...

The only explanation I can think about is that you use some old libraries... Do you have environment variable JSAGA_HOME set to an older installation of JSAGA ?

Cheers,
Sylvain

    (1-7/7)