Execute command/script after file transfer

1

I've configured a server (Ubuntu) with OpenSSH for file transfer via sFTP. The requirement is that after a file transfer, a mail is sent confirming the file was received by the system. How would I do this without having to poll the directory every x time for new/changed files?

Gunther De Poortere

Posted 2012-01-26T09:33:09.697

Reputation: 11

Answers

0

Refer Checking script results and Send a mail and Automate file transfers (or synchronization) to FTP server or SFTP server

Example: sending a email using command prompt

winscp.com /script=example.txt
if errorlevel 1 goto error

echo Success
sendmail.exe -t < success_mail.txt
goto end

:error
echo Error!
sendmail.exe -t < error_mail.txt

:end

Refer one more answer related to sending an email, Sending mail from the command line, in an automated way

Siva Charan

Posted 2012-01-26T09:33:09.697

Reputation: 4 026

Thanks for your answer, however this is on the client side, I'd like to do this on the server side without any additional commands issued by the client. – Gunther De Poortere – 2012-01-26T10:52:29.000