issues with synchronization command

Advertisement

srtravis
Joined:
Posts:
2

issues with synchronization command

I am working on a synchronization command in a batch file but for some reason it always returns the "Nothing to synchronize." result even though the remote folder is clearly full of files and the local folder is empty.

command output:
U:\>"C:\splunk-inputs\WinSCP\winscp.com" /command "open sftp://incapsula_logs@xxxxx" "synchronize local c:\splunk-inputs\incapsula\streaming\ /pub/incapsula/streaming/ -delete" "exit"
Searching for host...
Connecting to host...
Authenticating...
Using username "incapsula_logs".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] incapsula_logs@xxxxx
Using configured synchronization options different from factory defaults.
Comparing...
Local 'c:\splunk-inputs\incapsula\streaming' <= Remote '/pub/incapsula/streaming'
Nothing to synchronize.



local folder:
U:\>"C:\splunk-inputs\WinSCP\winscp.com" /command "open sftp://incapsula_logs@xxxxx" "lls c:\splunk-inputs\incapsula\streaming " "exit"
Searching for host...
Connecting to host...
Authenticating...
Using username "incapsula_logs".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] incapsula_logs@xxxxx
05/15/2018 12:50 PM <DIR> ..



remote folder:
U:\>"C:\splunk-inputs\WinSCP\winscp.com" /command "open sftp://incapsula_logs@xxxxx" "ls /pub/incapsula/streaming" "exit"
Searching for host...
Connecting to host...
Authenticating...
Using username "incapsula_logs".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Session started.
Active session: [1] incapsula_logs@xxxxx
drwxr-xr-x 2 21909 10005 210944 May 15 13:21:23 2018 .
drwxrwxrwx 3 21909 10005 4096 May 15 0:12:09 2018 ..
-rw-r--r-- 1 21909 10005 10519 May 15 13:21:23 2018 672_826772.log
-rw-r--r-- 1 21909 10005 78764 May 15 13:21:22 2018 672_826771.log
-rw-r--r-- 1 21909 10005 3776 May 15 13:21:21 2018 672_826770.log
-rw-r--r-- 1 21909 10005 1442 May 15 12:53:50 2018 672_826741.log
-rw-r--r-- 1 21909 10005 25750 May 15 13:21:21 2018 672_826769.log
-rw-r--r-- 1 21909 10005 36120 May 15 13:13:33 2018 672_826765.log
-rw-r--r-- 1 21909 10005 60852 May 15 13:21:20 2018 672_826768.log
-rw-r--r-- 1 21909 10005 1063 May 15 13:13:32 2018 672_826764.log
-rw-r--r-- 1 21909 10005 14874 May 15 12:36:37 2018 672_826713.log
-rw-r--r-- 1 21909 10005 29101 May 15 13:00:13 2018 672_826748.log
-rw-r--r-- 1 21909 10005 17504 May 15 12:47:59 2018 672_826733.log
-rw-r--r-- 1 21909 10005 1069 May 15 12:53:49 2018 672_826740.log
-rw-r--r-- 1 21909 10005 3107 May 15 12:36:36 2018 672_826712.log
-rw-r--r-- 1 21909 10005 34218 May 15 13:06:43 2018 672_826757.log
-rw-r--r-- 1 21909 10005 9914 May 15 12:53:47 2018 672_826738.log
-rw-r--r-- 1 21909 10005 20667 May 15 12:53:47 2018 672_826737.log
-rw-r--r-- 1 21909 10005 23151 May 15 12:47:59 2018 672_826732.log
-rw-r--r-- 1 21909 10005 2191 May 15 12:47:58 2018 672_826731.log
-rw-r--r-- 1 21909 10005 1036 May 15 12:42:27 2018 672_826723.log
-rw-r--r-- 1 21909 10005 18165 May 15 12:42:27 2018 672_826722.log
Description: level1 logging output from sync command

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,453
Location:
Prague, Czechia

Re: issues with synchronization command

You have configured WinSCP to synchronize only existing files in GUI:
< 2018-05-15 13:28:49.578 Script: Using configured synchronization options different from factory defaults.
< 2018-05-15 13:28:49.578 Script: Comparing...
. 2018-05-15 13:28:49.579 Collecting synchronization list for local directory 'c:\splunk-inputs\incapsula\streaming\' and remote directory '/pub/incapsula/streaming/', mode = Local, params = 0x407 (Delete, NoConfirmation, ExistingOnly, BySize), file mask = ''

You better isolate your script from GUI configuration:
https://winscp.net/eng/docs/scripting#configuration

Reply with quote

Advertisement

You can post new topics in this forum