I want to automate the process of copy a file from Windows FTP location to a Unix box from my Windows 7 machine.
I have managed to search the net and succeed to the point of connecting to the Unix box using SSH and PuTTY.
The input file to PuTTY contains the commands, but it stops at password and I couldn't find a way to overcome this.
To do this I have a created a batch file, so I can schedule a Windows job on my Windows 7 machine to start copy a file everyday from the Windows FTP server (other Windows machine not mine) to the Unix box.
Batch file:
putty -ssh lxdsdsp0 -l "user_1" -pw "mypass" -m "D:\cmd.txt" -t
My cmd.txt
cd /x06/scratch-data/
ftp domain\user_1@winapp67.sr.dv.com
mypass
/bin/bash
When I execute my batch file, it logs in to the Unix box through SSH and types the commands but stops when I have my password as input file in the PuTTY cmd.txt file.
Please help.
Using username "user_1".
Welcome to SuSE Linux Enterprise Server 9 (x86_64)
Connected to domain\user_1@winapp67.sr.dv.com.
220 Microsoft FTP Service
331 Password required for domain\user_1.
Password:
530 User domain\user_1 cannot log in.
ftp: Login failed.
ftp>