Solved

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

Posted on 2008-10-10
4
1,807 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

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,…
This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now