Topic "opening session.... is deprecated"

Author Message
michaewlewis

Guest


I've been using a script to download a daily file from a server for several years and recently had to change to a new server that holds my file in a different directory. I changed the location in the script, but now I get a couple of new errors in the log (custom built log to echo everything the script does into a text file) which says:
"Opening session using command-line parameter in scripting is deprecated. Use 'open' command instead.
Error occurred during logging. It's been turned off."

Here's the part of the script which I use to run WinSCP:
%WinSCP% %profile% /log="%log%" /command "option batch on" "get -delete %remotedir%*.jdb %localdir%" exit

Which runs as:
"C:\Program Files (x86)\WinSCP\winscp.com" SISSVRUTIL02 /log="D:\Scripts\AVDefsDLLog.txt" /command "option batch on" "get -delete /*.jdb D:\VirusDefs\Temp\" exit



Any idea what could be causing this error?
Thanks.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Quote:
"Opening session using command-line parameter in scripting is deprecated. Use 'open' command instead.


The command-line format you are using was never really allowed and definitely not recommended, you should do:

%WinSCP% /log="%log%" /command "option batch on" "open %profile%" "get -delete %remotedir%*.jdb %localdir%" exit

Quote:
Error occurred during logging. It's been turned off.

There should be more details about the error following the above line.
Anyway, I assume the path to the log file is not valid or is not writable.
_________________
Martin Prikryl
michaewlewis

Guest


Thanks for the tip. That fixed it.
The problem with the log error was that I was using the batch file to write other information to the log file. It's acting as though the log file was locked for the batch file's usage and the WinSCP log function couldn't access it because of that. So, now I'm writing a log file for each process.

Thanks for your help!
moko2

Guest


Simply want to open the winscp site using a script. The script contains:
open sftp://usernameremoved.passwordremoved@example.com/

Yet when the script run, the host is searched for and does not appear.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
moko2 wrote:
Simply want to open the winscp site using a script. The script contains:
open sftp://usernameremoved.passwordremoved@example.com/

Yet when the script run, the host is searched for and does not appear.


I assume you use wrong syntax of WinSCP command-line, making WinSCP use some random part of the syntax as a host name.
Please read scripting and command-line documentation properly:
http://winscp.net/eng/docs/guide_automation

If that does not help, please start a new thread and attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License