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
Personal Internet VMware PHP Linux Shell Bluecoat Proxy Windows Hardware Virtualization Nagios MySQL DB Monitoring Mail Android Network Wyse Hacks Tomcat Postgres Apple Mac Backup BSD ZFS Solaris SmartOS Unix Multimedia Perl Database MongoDB CMS OTRS FreeBSD Wordpress LXC Nginx Proxmox DNS Graphics GlusterFS Security Chef HAProxy Icinga Ansible HTML MariaDB Containers Rancher Docker AWS ELK Kibana Logstash Filebeat Varnish PGSQL PostgreSQL ElasticSearch CouchDB Bash Macintosh Container Minio Grafana InfluxDB Databases NFS OSSEC SystemD Java Zoneminder Surveillance Elasticsearch SSL TLS Icingaweb2 Cloud Wireless Kubernetes Ubuntu