Checking files on Remote server

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
DEEPTI
Participant
Posts: 9
Joined: Wed Nov 21, 2007 12:19 am

Checking files on Remote server

Post by DEEPTI »

Hi All,

We have a Sequnecer job design as below:

4 jobs running in parallel that load 4 CSV files in the remote server.

If any of the job aborts, our requirement is to remove the CSV files which are loaded by the other jobs.

What is the method to check whether the files exist in the remote server
and to remove them in DataSatge?

Thanks in advance,
Deepti
syeed
Participant
Posts: 19
Joined: Fri Jan 19, 2007 12:35 am
Location: bangalore

Re: Checking files on Remote server

Post by syeed »

Hi Deepti,

u can do it through Shell script, I had the similar situation.
login into ur remote server as telnet
####################Code####################
(
echo USERID;
sleep 2;
echo PWD;
sleep 2;
echo "rm FILE_PATH/filename";
sleep 2;
)| telnet SERVER_NAME>log.txt

OR if you want to look for the files existence then u want to delete u can do it using SHELL script, let me know if you need code for this.

thanks,
Waseem
Syed
---------
Wait and Watch
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

method to check the files exists in server is using waitforfile activity .
To delete files if any job aborts using trigger conditions by your design and finally delete files
Post Reply