We’ve got just lately been concerned in one of many automations the place we should add the csv file routinely day by day to vendor Safe FTP.
This time we’ve utilized Python as an alternative of PowerShell due to challenge necessities.
I’m sharing the code samples right here to realize it.
Module required:
Obtain the code samples from git hub
https://github.com/VikasSukhija/Python
First Pattern à fetchhostkeyssftp
This script pattern will help you in fetching the host keys from spftp and reserve it in designated folder.
That is required many a instances by secureftp to keep away from man within the center assaults.
One other code pattern is Upload2Sftp:
This script will add the csv file from native path to distant path.
As within the above screenshot you may see native path is D:tempvendor.csv and it’ll add to root/import/vendor.csv on sftp server.
Observe: These are code samples solely and never the entire script.
Thanks for studying ….
Tech Wizard