Delete file after FTP
Moderators: chulett, rschirm, roy
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.
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.
Aim high
Did you read any of my posts? Did you checkout using scp and ssh? Why use the FTP stage to do something so simple?
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
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?kcbland wrote:Did you checkout using scp and ssh? Why use the FTP stage to do something so simple?
Aim high
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.
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.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
How do I use SCP or SSH to do the same operations?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.
Aim high
Please research on your own about scp and ssh. I've already posted enough about them to describe their benefits.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
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?kcbland wrote:Please research on your own about scp and ssh. I've already posted enough about them to describe their benefits.
Aim high
You can use scp in a server job. But as there is no stage to do this, you will need to shell out.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
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.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.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
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.kcbland wrote: You're asking about doing things that the FTP stage can't possibly do. Your only solution to getting all of the
Aim high
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.kcbland wrote:Okay, I'm done arguing. You win. I thought you needed to send multiple files. I'm obviously confused.
Aim high