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 "Automatic File Transfer"
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):
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.
ck from Switzerland wrote on Jan 25th, 2019:
Hello dl. It's been a long time since I done a batch script. Maybe you should give Filezilla a shot, it also allows to use Filezilla on the command line: https://wiki.filezilla-project.org/Command-line_arguments_(Client). You can prepare the FTP settings in the site manager and then call it from the cli using -c or --site.
dl from wrote on Jan 25th, 2019:
how to do it if I use proxy without credential
AWS Android Ansible Apache Apple Atlassian Automation BSD Backup Bash Bluecoat CMS Chef Cloud Consul Container Containers CouchDB DB DNS Database Databases Docker ELK ElasticSearch Elasticsearch Filebeat FreeBSD GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Icingaweb2 InfluxDB Internet Java Kibana Kubernetes LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS PGSQL PHP Perl Personal PostgreSQL Postgres PowerDNS Proxmox Proxy Rancher SSL Security Shell SmartOS Solaris Surveillance SystemD TLS Tomcat Ubuntu Unix VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Zoneminder