Deleting a file from DS on windows server
Moderators: chulett, rschirm, roy
Deleting a file from DS on windows server
I pick up a file from a windows server via ftp and copying it on my unix DS server.
At the end of my job i need to delete both files: the one on my DS unix server and the one on windows server.
1 - To delete the file on DS unix server i think i can call DS stage from sequence job "ExecuteCommand"... writing "rm path/filename" on "Command" line... right?
2 - to delete the file on windows server i think i need ftp.. should i use the same stage ExecuteCommand on sequence job? or is ther any other possibility?
i think i should write an .sh file and invoke it from Command line.... could this syntax be right?
ftp remote_server
user remote_user remote_pwd
cd remote_path_where_is_my_file
prompt
delete remote_file
eof
should i use delete? or dele?
thank you
A.
At the end of my job i need to delete both files: the one on my DS unix server and the one on windows server.
1 - To delete the file on DS unix server i think i can call DS stage from sequence job "ExecuteCommand"... writing "rm path/filename" on "Command" line... right?
2 - to delete the file on windows server i think i need ftp.. should i use the same stage ExecuteCommand on sequence job? or is ther any other possibility?
i think i should write an .sh file and invoke it from Command line.... could this syntax be right?
ftp remote_server
user remote_user remote_pwd
cd remote_path_where_is_my_file
prompt
delete remote_file
eof
should i use delete? or dele?
thank you
A.
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
1. That approach for deleting the file on your DS server is fine.
2. To delete the file on the remote machine you can use the Telnet properties in the FTP stage:
You'll need to set Prompt 3 to whatever prompt you get when you Telnet to that server using the supplied account. Remember you can use job parameters for any of these properties.
J.
2. To delete the file on the remote machine you can use the Telnet properties in the FTP stage:
Code: Select all
Telnet Prompt 1 Login
Telnet Reply 1 {youraccount}
Telnet Prompt 2 Password
Telnet Reply 2 {yourpassword}
Telnet Prompt 3 $
Telnet Reply 3 rm {path}/{file}
J.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
i tried that, but my doubts are :
1- remote machine is a windows machine... should i use rm or delete?
2- in any case, with both of those commands, Director backs this message: Job jobName has no active stages... what it means? i have a server job with just ftp plugin inside, with no inputs and no outputs...
cannot understand...
thanks
1- remote machine is a windows machine... should i use rm or delete?
2- in any case, with both of those commands, Director backs this message: Job jobName has no active stages... what it means? i have a server job with just ftp plugin inside, with no inputs and no outputs...
cannot understand...
thanks
1. For the remote machine, use "del" as that is guaranteed to work in Windows.
2. The warning about no active stages is correct - the FTP stage is a passive stage.
2. The warning about no active stages is correct - the FTP stage is a passive stage.
Last edited by ArndW on Fri Oct 20, 2006 4:42 am, edited 1 time in total.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
Sorry - I've been writing alot of Korn shell script recently and old habits die hard ...
Yes, for Windows you'd submit DEL.
(Ah, yes ... I remember Windows ... popular in the 90's, wasn't it!?)
Arnd - I think that's the second time in as many weeks that you've spotted the deliberate mistake in my post! See you next week
J.
Yes, for Windows you'd submit DEL.
(Ah, yes ... I remember Windows ... popular in the 90's, wasn't it!?)
Arnd - I think that's the second time in as many weeks that you've spotted the deliberate mistake in my post! See you next week
J.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
I don't know if I noticed anything wrong, since so many Windows machines now have MKS toolkit or similar extensions and thus the "rm" command is pretty much standard.jhmckeever wrote:...Arnd...J.
Are we going to meet next week??
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Premium Member
- Posts: 301
- Joined: Thu Jul 14, 2005 10:27 am
- Location: Melbourne, Australia
- Contact:
Probably - I'm anticipating that we'll meet in this forum when you correct next week's deliberate mistake.
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
Craig - he is getting a warning that his job has no active stages. His job has no active stages.
Last edited by ArndW on Fri Oct 20, 2006 7:17 am, edited 1 time in total.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Ok... there's no reason for the job to throw those.... necessarily. I assume there are no stages on the canvas, so the issue would be the fact that all there is 'code wise' is a before/after subroutine call. That's the only time I recall seeing that warning.
What I do is code directly in the Job Control tab instead when I need to do stuff like that - run O/S commands or scripts, for example - and it avoids having this warning every time the job runs.
What I do is code directly in the Job Control tab instead when I need to do stuff like that - run O/S commands or scripts, for example - and it avoids having this warning every time the job runs.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
i have 1 server job with an ftp stage inside... and just that!
in ftp stage properties i have parameters as you told me before...
server name: <myFTPServer>
remote FTP Port: <myFtpPort>
User Name : <FtpUser>
User Password : <FtpPwd>
telnet prompt 1 : login
telnet reply 1 : <FtpUser>
telnet prompt 1 : pwd
telnet reply 1 : <FtpPwd>
telnet prompt 1 : file to delete
telnet reply 1 : /folder/subfolder/filename (no C:/.... could this be a problem? hope no)
when starting job, only logging message on Director is "Job DeleteFileOnWindowsServer has no active stages"
should i have some stages more?
should i define pathName with C:/allPath/fileName ?
in ftp stage properties i have parameters as you told me before...
server name: <myFTPServer>
remote FTP Port: <myFtpPort>
User Name : <FtpUser>
User Password : <FtpPwd>
telnet prompt 1 : login
telnet reply 1 : <FtpUser>
telnet prompt 1 : pwd
telnet reply 1 : <FtpPwd>
telnet prompt 1 : file to delete
telnet reply 1 : /folder/subfolder/filename (no C:/.... could this be a problem? hope no)
when starting job, only logging message on Director is "Job DeleteFileOnWindowsServer has no active stages"
should i have some stages more?
should i define pathName with C:/allPath/fileName ?