1748256 Members
3654 Online
108760 Solutions
New Discussion юеВ

FTP Script

 
Saqib Abbasi
New Member

FTP Script

Through FTP I want to download some file from Server A to Workstation and I am using NT Workstation as a Client and I want this script run every night and download required files in specific folder and close.

Note :- Server give us FTP access and we are using CuteFTP but its need to somebody start and download we need automatic system.
Saqib Abbasi
7 REPLIES 7
Frank Slootweg
Honored Contributor

Re: FTP Script

For the moment I left this question in the hp-ux forum, but I think it is a pure (MS-)Windows question.

Anyway, your MS-Windows client probably has the "AT (command line utility) or/and "Scheduled Tasks" (probably under "My Computer" or/and Start -> Programs -> Administrative Tools (Common)).

With that, you can time-schedule a batch (.bat) file which does the FTP.
Saqib Abbasi
New Member

Re: FTP Script

Thank you for reply but this is not answer of my question problem is this how can I write script that connect with FTP server because its need user name and password. also after that I need that script to write in Oracle so its update our Database. if not understand please mail me sabbasi.c@stc.com.sa
Saqib Abbasi
A. Clay Stephenson
Acclaimed Contributor

Re: FTP Script

If you use that little 'Search' button and do a boolean search on FTP AND Perl, you will find some scripting examples that take care of the password and will work in the Windows world after you download and install the freely available Perl.
If it ain't broke, I can fix that.
Frank Slootweg
Honored Contributor

Re: FTP Script

See the Windows Help facility, i.e. on my system (NT):

Start -> Help -> Windows NT Commands -> Windows NT Commands -> F -> ftp

Specifically see the "-s: filename" option:

> Specifies a text file containing ftp
> commands; the commands will automatically
> run after ftp starts. No spaces are allowed
> in this parameter. Use this switch instead
> of redirection (>).

See also "ftp commands" in the same Help.
Ricardo Bassoi
Regular Advisor

Re: FTP Script


Hi,

If you desire to to a FTP from a machine ( UNIX, WINDOWS ..) to a PC client you must install an FTP server in you machine like:

ftp://ftp.vampyrelestat.com/pub/internet/servers/ftp/GuildFTPd.exe

Hope it helps...

Regards,

Bassoi
If you never try, never will work
Fragon
Trusted Contributor

Re: FTP Script

Demo data: Server A: /home/ftp/pub
Files you want to get: file.tst
Username: anonymous
Password: ident
Directory in Workstation you want to put your file after get from the server: C:\ftp
Maka a scheduled task in Workstation to run the script run.bat.
The following is a run.bat file:
@echo off
c:
cd echo user anonymous ident > tmp.txt
echo bin >>tmp.txt
echo cd /home/ftp/pub >>tmp.txt
echo get file.tst >>tmp.txt
echo bye >>tmp.txt
ftp -n -s:tmp.txt IP_address_of_the_server


-Live as you wish-
Gerald zhou
Fragon
Trusted Contributor

Re: FTP Script

Sorry ,"cd echo user anonymous ident > tmp.txt" should be:
cd
echo user anonymous ident >tmp.txt

-Gerald-