Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a windows server 2003 which generates backup file to ftp folder in the server(using my own script). And I will ftp and copy it to my local hard disk daily. How can I automate this process using any scripts?

Edit-- I want to pull the archive(rar format) file which will be around 50MB, I am using Windows 7 on my local and using windows FTP in the server. Authentication and encryption is not required currently

share|improve this question
Do you want to pull or push? What OS are you running on your local hard disk? How much data is there? what backup software are you using? What FTP server software is this running? Do you require authentication? Do you want this transfer encrypted? There are other questions that need to be asked, but the basic idea I'm hoping to convey to you is that you need to provide WAY more info than what is here. – Rex Jun 12 '13 at 6:39
@Rex I have edited for your query, I don't want to complicate things. It's just a simple question. – Nithin Jun 12 '13 at 6:50
up vote 1 down vote accepted

Assuming your workstation is windows based (other OS's ftp clients work similarly though)

ftp -help

Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.

FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuf
fer] [-b:asyncbuffers] [-w:windowsize] [host]

  -v              Suppresses display of remote server responses.
  -n              Suppresses auto-login upon initial connection.
  -i              Turns off interactive prompting during multiple file
  -d              Enables debugging.
  -g              Disables filename globbing (see GLOB command).
  -s:filename     Specifies a text file containing FTP commands; the
                  commands will automatically run after FTP starts.
  -a              Use any local interface when binding data connection.
  -A              login as anonymous.
  -x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
  -r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
  -b:async count  Overrides the default async count of 3
  -w:windowsize   Overrides the default transfer buffer size of 65535.
  host            Specifies the host name or IP address of the remote
                  host to connect to.

  - mget and mput commands take y/n/q for yes/no/quit.
  - Use Control-C to abort commands.

Note the -s:filename. All you have to do is create a text file that contains the commands you would type manually to retrieve the file. Something like

lcd c:\savedbackups
cd c:\backup\directory
get backup.file

Then if the file is backups.ftp you can use it as

ftp -s:backups.ftp

You can find a list of available ftp commands by running the client and typing help.

In the example above the ftp client will connect to, provide the username xyzzy and the password plugh. It then changes to the local directory c:\savedbackups and the remote directory c:\backup\directory and pulls a copy of backup.file using a binary mode transfer.

share|improve this answer
This is not working properly, connection is getting delayed may be due to the file size – Nithin Jun 12 '13 at 7:17
@Nithin: It does work correctly, you probably have other problems that you need to resolve. Just saying HALP! this doesn't work is useless to me and everyone else. Go away, do some research, come back when you have some details on what you've done, what's not working and what you've done to try and resolve it. – Iain Jun 12 '13 at 7:22
This worked like charm, but how can I make it secure as I will be sending my login credentials directly. SFTP?? – Nithin Jun 12 '13 at 7:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.