Here is another solution of how to download all files from a remote server folder to your local folder, using the command line and winscp scripting:
Download and install WinSCP: https://winscp.net/eng/download.php
Create a batch file e.g. "ftp-automate.bat" in a custom folder of your choice (e.g. "C:\customfolder").
Edit the batch file "ftp-automate.bat" and add this content:
@echo off
echo Starting WinSCP
"C:\Program Files (x86)\WinSCP\WinSCP.com" /script="C:\customfolder\winscp-script.txt"
echo WinSCP finished
- Create the file "winscp-script.txt" in "C:\customfolder\winscp-script.txt" and add this content:
# Connect to SFTP server
open sftp://USERNAME:PASSWORD@HOSTORIP
# Download remote to local folder
get /var/lib/myfolderofinterest/* C:\mylocalfolder\
# optional: Remove remote files (remove #)
# rm /var/lib/myfolderofinterest/*
# Exit WINSCP
exit
Of course, you have to replace USERNAME
with your FTP username, PASSWORD
with your FTP password and HOSTORIP
with your domain (ftp.mydomain.com) or IP address (12.34.56.78).
Security Note: Make sure the above script file on your PC is safe because it contains the credentials (password) to your server!
Tip: You might want to use Windows Task Scheduler (Action > Create Basic Task) to run the batch file once a day.