Solved

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

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
hosting email transfer 3 45
Run MS Access Module from Macro / Bat File 9 89
Batch/VBScript : Disable Windows tasks 7 34
Windows updates batch files 7 46
Have you ever stumbled upon a software that is so great that you just love? It happened to me. Love at first sight. Filezilla Server.   Ok its not the most advanced ftp server I've came across. But its a fairly simple piece of software to get the …
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 will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

831 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