Windows FTP – How to Create a BAT File for Scheduled Task

backupbatchftpscheduled-tasks

Is it possible to create a scheduled task in windows, that connects to an FTP site, and downloads all the files and folders within the root directory (or specified folders in the root directory) – for example \httdocs and \subdomains to a local directory?

I figure it must be possible, however i can't quite think of the syntax….

This is to backup my website, to the local drive – i edit and upload content to it (it's wordpress) from various sources.

Best Answer

See my question for the correct script; thanks @djhowell - your script got me started:

Here's the working script:

open ftp.yoursite.com
ftpUsername
ftpPassword
lcd C:\Temp\OrWhatever
cd /DirectoryOnFtpServer
prompt
mget *.*
quit

lcd - change LOCAL directory
cd - change REMOTE directory
mget *.* - get all files in directory

Related Question