Topic "synch script works Win 7 not Win XP (but GUI always works) - why!?"

Author Message
scottFTPer
[View user's profile]

Joined: 2016-04-09
Posts: 2
Hello. I am trying to synchronize a local drive with a folder on a file server using SFTP:

Source: local drive D:
Destination: file server folder at a known ip address
Mode: 'remote' - changes made at source are made at file server but not the other way (no deletion)

Problem: I wrote a very simple script that is called by a batch file run each night via Windows Task Scheduler; it opens the SFTP session, runs the synchronization command in 'remote' mode, then closes the session. This works perfectly on a Windows 7 32-bit machine I maintain. Unfortunately, it DOES NOT WORK on a Windows XP machine that I maintain. BUT, when I run the synch using the GUI Commander interface on this Windows XP machine, the sync works great!


Here is the command in the batch:
Code:
winscp.com /script=C:\SFTP_synchronize_script_CC_slicedata.txt >> "C:\Documents and Settings\Administrator\Desktop\Sync_results.txt" /log="C:\winscplog.log"


Here is the script:
Code:
open sftp://Username(removed):Password(removed)@XXX.XXX.XXX.XXX/
synchronize remote D:\ /Slice_Data/
close
exit


Attached: I have included the log file. In the log file you will see the line ". 2016-04-09 08:59:41.000 Local file 'D:\LMB\Quinpirole Dose Response\System Testing\test_sync_4-09-0837.txt' [2016-04-09T14:37:47.984Z] [16] is new
" ; I created the file test_sync_4-09-0837.txt locally to test the sync. Indeed it sees it as new, but it never syncs it! It ends with "< 2016-04-09 08:59:43.062 Script: Nothing to synchronize." !
If I run the GUI Commander Interface, it synchronizes this just fine and copies the file. What?!

I have not been able to solve this. I cannot upgrade the machine from Windows XP because the users have legacy hardware that they are using for their work.

Any help would be greatly appreciated!
winscplog_log.zip (1.73 MB) [Download]

Description: (none)

Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
The key point is:

Quote:
< 2016-04-09 08:57:15.046 Script: Using configured synchronization options different from factory defaults.
< 2016-04-09 08:57:15.046 Script: Comparing...
. 2016-04-09 08:57:15.046 Collecting synchronization list for local directory 'D:\' and remote directory '/Slice_Data/', mode = Remote, params = 0x406 (NoConfirmation, ExistingOnly, BySize)


See https://winscp.net/eng/docs/scripting#configuration
scottFTPer
[View user's profile]

Joined: 2016-04-09
Posts: 2



Thank you for your help! I looked at the doc and decided to try the "/ini=nul" option to force scripting mode to start with the default configuration.

This almost worked, but I had to add the ssh key with the "-hostkey=" option on the open command.

Then the script terminated due to a permissions error with the "System Volume Information" folder. Since I do not know how to exclude this folder (or others like the Recycler folder) in a WinSCP script, I changed the script to run the synchronization on the folders on the drive (I will just need to tell the users to inform me if they create new folders at the root directory).

Now it works, although I need to research how to exclude items so I can fix the problem with the recylcer and system volume information folders at the root of the drive.

Thanks for all your hard work on WinSCP over the years!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25025
Location: Prague, Czechia
scottFTPer wrote:
Then the script terminated due to a permissions error with the "System Volume Information" folder. Since I do not know how to exclude this folder (or others like the Recycler folder) in a WinSCP script, I changed the script to run the synchronization on the folders on the drive (I will just need to tell the users to inform me if they create new folders at the root directory).

Now it works, although I need to research how to exclude items so I can fix the problem with the recylcer and system volume information folders at the root of the drive.


Use synchronize -filemask="| System Volume Information/" remote ...
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