0

I'm looking to automate a process that will occur daily.

I receive a CSV file to a unix SFTP server once per day. I want to send the file contents (from the server) to an e-mail address (Exchange server) in order to be archived to Symantec Enterprise Vault.

I was thinking of using a mail API of sorts, but I'm having trouble figuring out where to start. How will the script grab the file from the UNIX SFTP server, and then send to the address?

Ryan
  • 1
  • Read [SFTP in Python? ](https://stackoverflow.com/questions/432385/sftp-in-python-platform-independent) – stovfl Aug 16 '17 at 15:43

1 Answers1

0

Basically it depends if you know when the file is created than you can use crontab to fire your python script that loads and sends it by mail.

another option is to use incron or one of the other tools to watch a folder like https://github.com/gorakhargosh/watchdog or https://github.com/cespare/reflex

Actually sending an email there are many ways in python for example the following gist is using mailgun smtp server to send an email https://gist.github.com/revolunet/4600258.

Srgrn
  • 1,770
  • 16
  • 30