Topic "XML Logging for two (or more) sites"

Author Message
ceejayemm
[View user's profile]

Joined: 2013-05-02
Posts: 2
WinSCP 5.9.4 on Windows Server 2008 SP2 32 bit

I am running the console version of WinSCP with the following command line:

"C:\Program Files\WinSCP\winscp.com" /ini=C:\ProgFiles\WinSCP\WinSCP.ini /script=E:\EDI_Data\WPM\Scripts\WPMInvoices.ftp /xmllog=downtrans.log

The script file has the following commands:

option batch abort
option confirm off
open "WPM Downloads"
lcd "\\abc.ac.uk\icprj01_wpm\in"
synchronize local -filemask="IMP0184-01_CI*.csv | _vti_cnf/; data_export/"
synchronize local -filemask="IMP0184-01_SI*.csv | _vti_cnf/; data_export/"
synchronize local -filemask="IMP0184-01_*Fees*.csv | _vti_cnf/; data_export/"
synchronize local -filemask="IMP0184-01_SA*.csv | _vti_cnf/; data_export/"
synchronize local -filemask="IMP0184-01_LI*.csv | _vti_cnf/; data_export/"
synchronize local -filemask="IMP0184-01_Sports*.csv | _vti_cnf/; data_export/"
lcd "\\abc.ac.uk\wpmexport"
synchronize local -filemask="IMP0184-01_PR*.csv | _vti_cnf/; data_export/"
open "WPM Online Store DL"
lcd "\\abc.ac.uk\icprj01_wpm\in"
synchronize local -filemask="IMP0184-01_Store*.csv | _vti_cnf/; data_export/"
exit

The XMLLOG function works fine for the first connection to "WPM Downloads" but as soon as it reaches the second site "WPM Online Store DL" then the logging stops although any files to be synchronized do so properly. Output at the DOS command prompt shows:

E:\EDI_Data\WPM\Reports\Invoices>"C:\Program Files\WinSCP\winscp.com" /ini=C:\ProgFiles\WinSCP\WinSCP.ini /script=E:\EDI_Data\WPM\Scripts\WPMInvoices.ftp /xmllog=downtrans.log
batch abort
reconnecttime 120
confirm off
In scripting you should not rely on saved sites, use this command instead:
open ftps://XXXX.education.com/ -rawsettings FtpListAll=0
Connecting to XXXX.education.com:990 ...
TLS connection established. Waiting for welcome message...
Connected
Starting the session...
Session started.
Active session: [1] WPM Downloads
\\ictsmb.ad.ic.ac.uk\icprj01_wpm\in
Using configured transfer settings different from factory defaults.
Comparing...
Local '\\abc.ac.uk\icprj01_wpm\in' <= Remote '/'
Nothing to synchronize.
Comparing...
Local '\\abc.ac.uk\icprj01_wpm\in' <= Remote '/'
Nothing to synchronize.
Comparing...
Local '\\abc.ac.uk\icprj01_wpm\in' <= Remote '/'
Nothing to synchronize.
Comparing...
Local '\\abc.ac.uk\icprj01_wpm\in' <= Remote '/'
Nothing to synchronize.
Comparing...
Local '\\ictsmb.ad.ic.ac.uk\icprj01_wpm\in' <= Remote '/'
Nothing to synchronize.
Comparing...
Local '\\abc.ac.uk\icprj01_wpm\in' <= Remote '/'
Nothing to synchronize.
\\abc.ac.uk\wpmexport
Comparing...
Local '\\abc.ac.uk\wpmexport' <= Remote '/'
Nothing to synchronize.
In scripting you should not rely on saved sites, use this command instead:
open ftps://XXXX.education.com/ -rawsettings FtpListAll=0
Connecting to XXXX.education.com:990 ...
TLS connection established. Waiting for welcome message...
Connected
Starting the session...
Session started.
Active session: [2] WPM Online Store DL
\\abc.ac.uk\icprj01_wpm\in
Comparing...
Local '\\abc.ac.uk\icprj01_wpm\in' <= Remote '/data_export'
Synchronizing...
Local '\\abc.ac.uk\icprj01_wpm\in' <= Remote '/data_export'
IMP0184-01_Store_20170512 | 2 KB | 31.6 KB/s | binary | 100%
IMP0184-01_Store_20170513 | 2 B | 5.9 KB/s | binary | 100%
IMP0184-01_Store_20170514 | 2 B | 3.2 KB/s | binary | 100%
IMP0184-01_Store_20170515 | 2 B | 2.2 KB/s | binary | 100%
IMP0184-01_Store_20170516 | 2 B | 1.6 KB/s | binary | 100%
IMP0184-01_Store_20170517 | 3 KB | 3.2 KB/s | binary | 100%
IMP0184-01_Store_20170518 | 2 B | 2.6 KB/s | binary | 100%


How can I get a full XMLLOG output for the entire script ?

Thanks

Chris
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26331
Location: Prague, Czechia
The logging is per-session, not per-script.

You can use patterns in the log file path to allow separate logs for individual sessions:
See https://winscp.net/eng/docs/ui_pref_logging#session_log
ceejayemm
[View user's profile]

Joined: 2013-05-02
Posts: 2
Martin - thanks for this pointer. I had to remove the /xmllog= option from the command line and configure an XML Log File location for each site being used in the script using the '!S' pattern option to name the XML log file. This then gave me the separate XML log files I needed for the complete script run.

Thanks for your help.

Chris
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