Solved

creating a script to schedule a bat file to connect to ftp site

Posted on 2008-10-10
4
1,826 Views
Last Modified: 2013-12-02
I need to create and schedule a script that runs on db server on windows plateform which runs certain sql-creates a output and then send the output to ftp site. If someone has worked on somthing like this I can use that as template and work on my own. Let me know.
thanks.
0
Comment
Question by:barfi
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 22689665
create a text file e.g. myftp.txt, like the one below :

username1
password1
lcd c:\mydir
cd /remdir
put file
quit

Here in the file above, username1 and password1 are the username and password on the ftp server
You may put the command binary or ascii before the put command
If you want to send multiple files then change the put command to

prompt
mput files*.* (for example)

Now create a .bat file that contains the command

ftp -s:c:\myftp.txt remoteserver

here remoteserver is the hostname or the ip address of the ftp server

Now schedule the .bat file to run at the time you want
0
 
LVL 2

Author Comment

by:barfi
ID: 22689757
Hi
This looks perfect - I just need to try and test it but I am staisfied with your answer. I just have a question on following commands:
lcd c:\mydir (is this command cding to the location of the file)
cd /remdir (what is this command doing?)
put file (should I say the name of the file after put or after put file then file name)
Sorry- if I am asking dummy qs but  this is my first time doing this and would like to get it all straighten out.
Thanks again
0
 
LVL 40

Accepted Solution

by:
omarfarid earned 500 total points
ID: 22689959
OK

I gave complete example where you use

cd /remdir

to change your dir on the ftp server to /remdir. This could be

cd c:\myremdir

if the remote server is a windows ftp server.

put is the command to sent a file to remote system. Please put your actual file name:

put myfile.dmp
0
 
LVL 2

Author Closing Comment

by:barfi
ID: 31505139
Thanks a Bunch!! I will try this out.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
bash script to unzip a file 5 60
network timeout on mapped drive 3 70
Powershell pass array of objects to another script 8 85
how to run this deletion request 4 30
Problem: Windows 32bit running out of paging space. Solution: Add additional page files on separate partitions. Background: By default Windows creates only one page file on the partition you install Windows on. You may know that the maximu…
Samba is the de-facto standard program (or, more correctly: suite of programs) that UNIX and Linux systems use to share files with Microsoft Windows (and more recently, Mac OS-X) systems. Currently, there are 2 common versions of Samba available,…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question