News, Product Information, and Tips
Check out our free utlities in the downloads section

Remote Administration



Remote Administration For Windows. Easy remote access of Windows 7, XP, 2008, 2000, and Vista Computers

Click here to find out more

Create Outlook Profiles



No more setup wizards in Outlook. Setup Outlook Profiles automatically from the command line

Click here to find out more

Network Administrator



Reboot Hundreds of computers, disable flash drives, deploy power managements settings.

Click here to get your free copy of Network Administrator. Over 25 plugins to make your life easier

USB Disabler



Disable Flash Drives for specific users, or only allow specific drives.

Click here for your free trial

Search

Archives

FTP Files Automatically

by Steve Wiseman on September 11, 2007 · 1 comment

in Windows

I have a backup log that I create every night…on three different servers. They are all separated by many miles across the Internet. I wanted to find an easy way to send them all to one central location, but at the same time I did not want to have any extra software to do it.

The key requirement of not needing additional software meant that I would need to script FTP in some way.

After playing around with it at the command line, I discovered the -s option. It allows you to feed it a file that it will use to play back ftp commands.

Lets look at what I need to do to send this file

1. Connect to the host (ftp.somesite.com)

2. Send the username and password (administrator/Password1997)

3. Send the file (c:\logs\backups.log)

4. Disconnect

In FTP commands this converts to:

open ftp.somesite.com
administrator
Password1997
bin
put c:\Logs\Backup.log
quit

the bin command makes sure that ftp does not try to do any text conversions with the file.

Save the script to a file (In my case I called it FtpScript.txt)

FTP Automatically Backup

Now if we call it at the command line it will automatically upload the file

(ftp -s:FtpScript.txt)

FTP Automatically Backup Script

Now I can schedule it to run every night, and the backup logs are uploaded automatically.

Like this article? Then sign up for my newsletter to get free tips and software sent right to your inbox once a week. Like you, I hate spam – I will never spam, or sell your email address.

Related Articles:

{ 1 comment… read it below or add one }

1 MJ June 9, 2010 at 5:06 pm

This is great. Do you have a way to automate e-mail files to auto upload to an FTP site? For example, taking an attachment from an e-mail file that is sent to you daily and automating the uploading to an FTP site.

Any ideas or programs?

Leave a Comment

Category Links - Windows Forum - Exchange Forum