Solved

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

Posted on 2008-10-10
4
1,832 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

742 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