Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Lekick

Solution

REM connect to ftp via winscp and runs syncronization
REM winscp syntax open ftp://<username>@<host> -explicittls
winscp.com /log="OrganizationEXEDownload.log" /command ^
"open ftp://username:Password.organization.org/ -explicittls -rawsettings MinTlsVersion=10 MaxTlsVersion=12 -timeout=60"^
"synchronize local . /Organization750 " ^
"exit"
Lekick

also let me know if i should delete this and move this to the scripting thread instead realize that might have been more appropriate.
Lekick

Add timeout to Existing script

Hi
Let me start by apologizing for what might be a easy and silly question.
I inherited support of a PowerShell script that opens a WinSCP sessions to an FTP to download and replace some files daily.

Recently came to the conclusion since both sender and receiver servers are slow combined with some firewalls rules the session time out.
So I need to increase session timeout.

Tried to add timeout command with help from a colleague, that did not work.
After checking similar post I have realized this ($session.Timeout = New-TimeSpan -Seconds 120) seems to be the best solution.
But I'm still terrible unsure where in the script this parameter goes to be applied since our formating seems to be different that most.

I have added both old and last attempt as file and copypasted it below.

New (didn't work)
REM connect to ftp via winscp and runs syncronization
REM winscp syntax open ftp://<username>@<host> -explicittls
winscp.com /log="OrganizationEXEDownload.log" /timeout=60 /command ^
   "open ftp://username:Password.organization.org/ -explicittls "^
   "synchronize local . /Organization740 " ^
    "exit"

Old
REM connect to ftp via winscp and runs syncronization
REM winscp syntax open ftp://<username>@<host> -explicittls
winscp.com /log="OrganizationEXEDownload.log" /command ^
   "open ftp://username:Password.organization.org/ -explicittls "^
   "synchronize local . /Organization740 " ^
    "exit"