| Author |
Topic  |
|
|
warrentyler
Starting Member
USA
6 Posts |
Posted - 07/26/2011 : 14:22:00
|
Hi, I have been using a SQL Server job Step to connect to a regular FTP site. Basically I create a job step with this info: 1) Operating system (CmdExec) Step: FTP -s:K:\FTP\ftpauto1.txt Which: 1) Opens a DOS prompt at c:\documents and settings.... 2) reads FTP from the job step, then -s: (driveletter):\path\script file containing the FTP commands to connect get a files etc.
My issue with creating the job step using SQL Server job is: When the DOS prompt opens at: c:\documents and settings.... I don't know how to tell it to: CD to D:\ drive, cd to a directory FTP to find the PSFTP.exe and run my script file.
I need the SQL job step to do this: C:\, cd d:, d:\ cd ftp, to end here D:\FTP.
Anyone know if I can do this in the SQL job step?
Thanks,
Chris |
|
|
russell
Pyro-ma-ni-yak
USA
4964 Posts |
Posted - 07/26/2011 : 14:34:40
|
For multiple line OS commands, I'll put it in a .cmd file and have the job execute that.
By the way, you dont need the c:\, cd d:
Just go straight to D:\ftp |
Edited by - russell on 07/26/2011 14:35:32 |
 |
|
|
warrentyler
Starting Member
USA
6 Posts |
Posted - 07/26/2011 : 16:20:52
|
OK.
The above steps are to run a script using FTP.
My issue with the different directory etc, is getting SQL Server to fire a Putty Secure FTP command.
The Putty executable is on D:\FTP
If I run everything manually in DOS these are the successful commands:
d: cd d:\ftp psftp (FTP server name) -l (ID) -pw (PW) -b (The script file to run with the putty commands)
So normally in my SQL job step using regular FTP, I put :
FTP -s:K:\FTP\ftpauto1.txt
But I haven't been able to create a SQL job strp to fire Putty and the command as above.
I have tried: d:\ftp psftp (FTP server name) -l (ID) -pw (PW) -b (The script file to run with the putty commands)
My result file said no results were found, I have 2 lines in the job step as opposed to just 1 above using regular FTP.
Thanks,
Chris |
 |
|
|
russell
Pyro-ma-ni-yak
USA
4964 Posts |
Posted - 07/26/2011 : 16:29:03
|
| just throw it in a batch file and call the batch file from the job. one line that way |
 |
|
|
warrentyler
Starting Member
USA
6 Posts |
Posted - 08/03/2011 : 13:59:36
|
Hi Russel,
Can you put the syntax here to call the batch file?
Thanks |
 |
|
|
russell
Pyro-ma-ni-yak
USA
4964 Posts |
Posted - 08/03/2011 : 16:09:35
|
just put the location of the file in. For example:
C:\dba\batchFile.cmd |
 |
|
| |
Topic  |
|