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

martin

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

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 ...
scottFTPer

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

martin wrote:




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

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

The key point is:

< 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

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

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:
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:
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!