Automate SFTP Script to download and delete the files after the download from the folder

Advertisement

Gazy007
Joined:
Posts:
5

Automate SFTP Script to download and delete the files after the download from the folder

Hi,

I have never scripted anything.
I have been trying or compiling a script to download files and delete the files after the download and send email if download fail.

Has anyone got ready something like this?

Reply with quote

Advertisement

Gazy007
Joined:
Posts:
5

Struggling to get this script

I have tried to script myself.
I could synchronize the files but I want to download the files and delete after the download from the folder.
Could someone please check why I am getting error.
I am trying to download all the files from download folder and delete after the download.
"#Resources Can be Found here - https://winscp.net/eng/docs/scripting

option batch abort
option confirm off
open sftp://admin:password123@myhost.com -hostkey="ssh-rsa 1024 NT733Kz444I4FmYVaVaG6tP9Tug8bU5l4tb+Ug1K168o=

get local C:\Temp\Target /folder/message/download -delete
exit"

Reply with quote

Gazy007
Joined:
Posts:
5

Hi Martin,

I have to admit it is not easy to find the information I am looking for.
I am grateful you have tried to help me a lot but I have not got what I need I managed to see
Session\Generate Session URL where I only see the site where I am connected. I can't see the command I executed. I could not find manage in the application.
I selected all files within download folder and chose Download and Delete but I could not find the command script anywhere. I am sorry to let you down.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
31,103
Location:
Prague, Czechia

Re: Hi Martin,

Did you follow this instruction?

To open the dialog to generate a file transfer code, use:

Reply with quote

Gazy007
Joined:
Posts:
5

The only time I could see Transfer settings when I am trying to connect. It only shows me the script to connect but no other options. I have attached a screenshot.

Capture.PNG

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
31,103
Location:
Prague, Czechia

Re: Hi Martin,

Gazy007 wrote:

Where is the transfer setting in WinSCP ?
Select the files you want to transfer, go to Files > Download.
Transfer Options dialog shows.
And then follow the instructions in my previous post.

Reply with quote

Advertisement

You can post new topics in this forum