Header RSS Feed
If you only want to see the articles of a certain category, please click on the desired category below:
ALL Android Backup BSD Database Hacks Hardware Internet Linux Mail MySQL Monitoring Network Personal PHP Proxy Shell Solaris Unix Virtualization VMware Windows Wyse

Create automatic ftp transfer script behind proxy on Windows
Tuesday - Oct 11th 2011 - by - (0 comments)

To create a batch script, which automatically makes an ftp transmissions is easy to do; but what if the host has no direct ftp access to the Internet and must use a proxy server?

Actually, it is not that different but the ftp syntax changes a lot. Once one knows how to do it is is soo easy.

Let's take a look at the batch file which will be executed on a daily manner (by the Windows Task Scheduler):


@echo off
echo "Automatic File Transfer"
echo "-----------------------------------"
ftp -s:ftplist.txt

Well this wasn't really different from a normal ftp batch file, the difference is the ftp syntax in the file which holds the ftp commands (ftplist.txt):

cd somedir
put test.txt

The big difference is the handling of the connection. Instead of connecting directly to the remote host (FTPHOST), the connection has to be established to the PROXYSERVER (Squid, Bluecoat, etc.).
Then the user authentication seems a bit strange to fellow ftp-users, but that's the way it works: The FTPUSER with the remote FTPHOST (similar to ftp by browser) followed by the user you will authenticate against your PROXYSERVER (your PROXYUSER).
The next two lines indicate the passwords: First the one for the ftp connection, the second one is the password for your proxy user.
After that you can launch your known ftp commands, put, get, dir, etc.


Add a comment

Show form to leave a comment

Comments (newest first):

No comments yet.

Go to Homepage home
Linux Howtos how to's
Monitoring Plugins monitoring plugins
Links links

Valid HTML 4.01 Transitional
Valid CSS!
[Valid RSS]

6979 Days
until Death of Computers