Page 1 of 1

How-to Delete remote file

Posted: Sun Nov 22, 2009 5:36 pm
by mavrick21
Hello,

I have a requirement to read files present on remote Windows shared drive and process it further. Once processing is complete the ETL code should be able to delete remote files. To read remote file on Windows shared drive I use FTP stage but I'm unable to figure out how to delete that file from DataStage or UNIX. If the remote server were to be UNIX then I would use rsh but not sure how to proceed since it's Windows server. Any help would be appreciated.

Thanks for your time

Posted: Sun Nov 22, 2009 6:00 pm
by chulett
I believe you would use rsh for this as well.

Posted: Sun Nov 22, 2009 6:15 pm
by lstsaur
On your windows server, install the Cygwin's OpenSSH server and client utilities. Then you should be able to delete the files on the Windows server.

Posted: Sun Nov 22, 2009 6:15 pm
by ray.wurlod
Does not the FTP stage allow an "after" telnet command? You could use this to delete the file.

Posted: Sun Nov 22, 2009 9:51 pm
by mavrick21
@chullet,
I believe rsh would work on remote Windows machine if MKS toolkit is installed and rsh is configured.

@lstsaur
Not sure if my Windows admin would let me install a Cygwin's server. I'll try Ray's advice first and if it doesn't work then I'll go with Cygwin approach.

@all
Thanks guys.

Posted: Mon Nov 23, 2009 7:26 am
by chulett
For the FTP stage, make sure you've got all of the permissions you'd need. Just because you can ftp somewhere doesn't automatically mean you can telnet there as well.

Posted: Mon Nov 23, 2009 10:03 pm
by mavrick21
Thanks Craig. I'll keep that in mind :D

Posted: Mon Dec 21, 2009 5:48 am
by jinm
ray.wurlod wrote:Does not the FTP stage allow an "after" telnet command? You could use this to delete the file.
in cases where you don't know which files you will get (ex 3 files one day 6 files next day) what if new file emerges just after you have "gotten" your files.

Don't you risk getting 3 files, but in the "after" you will delete 4 files ???

Posted: Mon Dec 21, 2009 5:49 am
by jinm
ray.wurlod wrote:Does not the FTP stage allow an "after" telnet command? You could use this to delete the file.
in cases where you don't know which files you will get (ex 3 files one day 6 files next day) what if new file emerges just after you have "gotten" your files.

Don't you risk getting 3 files, but in the "after" you will delete 4 files ???