Today’s article is about how to Automating SFTP Downloads using WinScp Free Tool:
This will be helpfull in many situations of which one is if you have your database hosted in Cloud by Hosted Services then for running reports etc. linking this database to another which is hosted locally, would mean you will need to automate SFTP downloads for that database and run restore script to Restore Database Automatically.
Procedure:
1. Install the WinScp Free Tool.
2. Access your FTP Site using SFTP(I used implicit FTP). If you cant access this then check your Firewall and see if this is blocked. Add exceptions to Firewall as needed.
3. Store a Session inside WinScp with Login and password credentials for Automating Downloads from FTP Site.
4. Run the above stored Session to see that it connects successfully.
5. Create a Schedule Task for Running a Program on Schedule as
"C:Program Files (x86)WinSCPWinSCP" /script=C:SQL-BackupBackupScript.txt
where “C:Program Files (x86)WinSCPWinSCP” is pointing to application
and /script=C:SQL-BackupBackupScript.txt is pointing to Script for Download as
option batch on
option confirm off
open xxx@pub.xxx.com
get /CloudDB_BackUp.bak C:SQL-Backup
exit
7. Run the task
8. The Backup should now be successfully downloaded to C:SQL-Backup folder.
Troubleshooting Tips:
If needed run the same script from CMD prompt.
First go to the location of program
cd C:Program Files (x86)WinSCPWinSCP
next run the Script
WinSCP /script=C:SQL-BackupBackupScript.txt
Learn about SQL Server detecting logical consistency based issues and how to resolve them.
Learn about SQL Server error 1222 and how to resolve the lock request time out…
Discover the new features of Microsoft SQL Server 2022 and how they compare to previous…
SQL Server Error 1222 lock request time out period exceeded Lock request time out…
SQL Server Error : 427, Severity: 20. Could not load the definition for constraint ID…
SQL Server Error : 204, Severity: 20. Normalization error in node %ls.
This website uses cookies.