Page 3 of 4

Posted: Fri Feb 29, 2008 3:08 pm
by chulett
Yep, do that 'all the time'. :wink:

Posted: Fri Feb 29, 2008 5:07 pm
by nkln@you
Hi All,

I can do that in shell script but i am passing multiple files to a ftp location. And that would mean creating multiple shell script which I want to avoid. Thats the reason I am thinking of using FTP stage to do this work. Is there any approach to do the same like doing everything in the AfterJob SubRoutine ExecSH. I am able to create a backup file using the Before Job SubRoutine ExecSH but how can i handle the exceptions. Say if FTP fails, we need to revert the backup file to the original file.

Please suggest the solution for the same.

Posted: Fri Feb 29, 2008 6:16 pm
by kcbland
Did you read any of my posts? Did you checkout using scp and ssh? Why use the FTP stage to do something so simple?

Posted: Mon Mar 10, 2008 10:47 am
by nkln@you
kcbland wrote:Did you checkout using scp and ssh? Why use the FTP stage to do something so simple?
I didnt understand the checkout using SCP And SSH. The only thing is I dont want to create a shell script when the same functionality is achievable in DS. So was wondering if its possible to do using FTP stage or just in the server job by having some Before/After Job Subroutine we can implement this?

Posted: Mon Mar 10, 2008 11:03 am
by kcbland
A before/after subroutine is just going to execute ftp, so I'm just saying you should use scp and ssh instead. That's a fairly great recommendation.

As for the FTP stage you take on a whole lot of other issues as it reads the file and requires highly structured and conforming data with the metadata, doesn't do compression, and is slower than command line FTP.

Posted: Mon Mar 10, 2008 11:55 am
by nkln@you
kcbland wrote:A before/after subroutine is just going to execute ftp, so I'm just saying you should use scp and ssh instead. That's a fairly great recommendation.

As for the FTP stage you take on a whole lot of other issues as it reads the file and requires highly structured and conforming data with the metadata, doesn't do compression, and is slower than command line FTP.
How do I use SCP or SSH to do the same operations?

Posted: Mon Mar 10, 2008 12:02 pm
by kcbland
Please research on your own about scp and ssh. I've already posted enough about them to describe their benefits.

Posted: Mon Mar 10, 2008 12:04 pm
by nkln@you
kcbland wrote:Please research on your own about scp and ssh. I've already posted enough about them to describe their benefits.
Please let me know if its possible to use Scp in a server job or not. and if using Scp is possible in a server job, then without going for shell script, is it possible to do the same operations?

Posted: Mon Mar 10, 2008 12:10 pm
by ArndW
You can use scp in a server job. But as there is no stage to do this, you will need to shell out.

Posted: Mon Mar 10, 2008 12:24 pm
by nkln@you
ArndW wrote:You can use scp in a server job. But as there is no stage to do this, you will need to shell out.
So it comes back to FTP stage where I can do all the operations without writing shell script.

Posted: Mon Mar 10, 2008 1:10 pm
by kcbland
nkln@you wrote:Hi All,

I can do that in shell script but i am passing multiple files to a ftp location. And that would mean creating multiple shell script which I want to avoid. Thats the reason I am thinking of using FTP stage to do this work. Is there any approach to do the same like doing everything in the AfterJob SubRoutine ExecSH. I am able to create a backup file using the Before Job SubRoutine ExecSH but how can i handle the exceptions. Say if FTP fails, we need to revert the backup file to the original file.

Please suggest the solution for the same.
Do you see your own post above? You're asking about doing things that the FTP stage can't possibly do. Your only solution to getting all of the things you want is to use multiple command lines to do it. SCP can copy multiple files easily, it's just like the cp command but it uses remote hostnames as part of its syntax. SSH can run commands remotely. All of your error trapping and troubleshooting will require you to handle the situations with custom logic. None of this can be done with the FTP stage, the after-command is limited.

Posted: Mon Mar 10, 2008 1:40 pm
by nkln@you
kcbland wrote: You're asking about doing things that the FTP stage can't possibly do. Your only solution to getting all of the
But FTP stage does all the operations I want it to do. It can take the backup of the file before doing the FTP. then it has rollback transaction command where i can restore the backup file as the Original file if the FTP fails. And if FTP succeeds then we have the Transaction Commit command line where I can delete the backup file. The FTP stage has multiple command line options where I can run multiple commands. So FTP stage does fulfill all of my requirements.

Posted: Mon Mar 10, 2008 2:21 pm
by kcbland
Okay, I'm done arguing. :cry: You win. I thought you needed to send multiple files. I'm obviously confused. :(

Posted: Mon Mar 10, 2008 2:26 pm
by nkln@you
kcbland wrote:Okay, I'm done arguing. :cry: You win. I thought you needed to send multiple files. I'm obviously confused. :(
Well You are not wrong. But my multiple files are in different folders and the picking time of all files are different. So i cant do everything in one shell script. This was the reason I wanted to go for FTP stage. and for each file, I am creating a job. But the problem remains the same. I am not able to figure out whats the telnet prompt. When I try to telnet the system(where DS is installed), it just gives me a blank screen. Any help on this.

Posted: Mon Mar 10, 2008 3:05 pm
by chulett
Are you not ftp'ing these files somewhere else meaning some other server? If so, why try to telnet to the DataStage server? :?

You need the telnet prompts and credentials from the remote server.