Exclude certain file on Synchronize
Is there a way to exclude certain file when using Synchronize. If yes, could you give me a simple example code.
Thanks
Advertisement
Advertisement
option exclude <yourfilename> synchronize ...
Advertisement
<2012-02-01 00:00:00
I have emailed you a link to development version of WinSCP.
Syntax file mask with timestamp is:
<2012-02-01 00:00:00
open ftp://username:password@ftpserver.itu.int synchronize local C:\TEST\docs /docs close
Advertisement
synchronize -filemask="<2012-02-01 00:00:00" local C:\TEST\docs /docs
synchronize -filemask="<2012-02-01 00:00:00" local C:\TEST\docs /docs
option include=*.doc* synchronize -filemask="<2012-02-01 00:00:00" local C:\TEST\docs /docs
synchronize -filemask="<2012-02-01 00:00:00" local C:\TEST\docs /docs -include="*.doc*"
synchronize -filemask="*.doc*<2012-02-01 00:00:00" local C:\TEST\docs /docs
Advertisement
synchronize -filemask="*.doc* *.ppt* <2012-02-01 00:00:00" local C:\TEST\docs /docs
synchronize -filemask="*.doc*<2012-02-01; *.ppt*<2012-02-01" local C:\TEST\docs /docs
Do not understand.Also, is it possible to have the new switch commands available for synchronize?
The up-to-date documentation is on the same page all the time:For my other question, is there a web page describing the new Synchronize command, with examples? If there is none yet, it's ok.
Advertisement
synchronize -filemask="*.doc*<2012-02-01; *.ppt*<2012-02-01" local C:\TEST\docs /docs
synchronizationResult = session.SynchronizeDirectories( SynchronizationMode.Local, @"C:\TEST\docs", "/docs", false);
Please use .NET assembly / COM library forum.What will be the equivalent command of filemask in .NET Assembly as shown below?
...
Advertisement
.protftpd.fifo
option exclude .proftpd.fifo
... include |.proftpd.fifo Comparing... Local '\\backup\backup3\Old' => Remote '/Old' Synchronizing... Local '\\backup\backup3' => Remote '/' \...\.proftpd.fifo | 0 B | 0,0 KB/s | binary | 0% ...
Please attach a full session log file showing the problem (using the latest version of WinSCP).I tried to use the "exclude" option to exclude a filebecause the file can for some reason not be transferred. The file is located on a NAS with Linux, where I have shared a folder via SMB. My script is otherwise working fine..protftpd.fifo
...
/log=C:\path\to\winscp.log
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.D:\Klinikdokumenter\Klinik - EDB\Klinik Backup\NAS Synchronization>"C:\Users\Administrator\AppData\Local\Programs\WinSCP\WinSCP.com" /loglevel=2 /loglevel=2 /log=logfi
le.log /xmllog=logfile.xml /script=glostrup-test2.txt
batch on
reconnecttime 60
include |.proftpd.fifo
Connecting to fjernskrivebord.tg150.dk:8021 ...
Connected
Starting the session...
Session started.
Active session: [1] **********@fjernskrivebord.tg150.dk
Comparing...
Local '\\backup\backup3' => Remote '/Test'
Synchronizing...
Local '\\backup\backup3' => Remote '/Test'
\...\.proftpd.fifo | 0 B | 0,0 KB/s | binary | 0%
Lost connection.
Timeout detected. (control connection)
Could not retrieve file information
Can't get attributes of file '/Test/.proftpd.fifo'.
(A)bort, (R)econnect (0 s): Reconnect
Connecting to fjernskrivebord.tg150.dk:8021 ...
Connected
Starting the session...
Session started.
Lost connection.
Timeout detected. (control connection)
Could not retrieve file information
Can't get attributes of file '/Test/.proftpd.fifo'.
(A)bort, (R)econnect (4 s): Abort
Lost connection.
Timeout detected. (control connection)
Could not retrieve file information
Can't get attributes of file '/Test/.proftpd.fifo'.
Copying files to remote side failed.
Session 'backupuser@fjernskrivebord.tg150.dk' closed.
No session.
Exit code: 1
Max roundtrip: 5569
D:\Klinikdokumenter\Klinik - EDB\Klinik Backup\NAS Synchronization>
option batch on
option reconnecttime 60
option exclude .proftpd.fifo
open -passive=on ftp://**********:***************@fjernskrivebord.tg150.dk:8021
synchronize -delete -criteria=either -transfer=binary -resumesupport=on remote "\\backup\backup3\" "/Test/"
exit
. 2020-05-14 01:08:29.219 Local file '\\backup\backup3\.proftpd.fifo' [2020-05-11T16:57:20.000Z] [0] included to synchronization
.proftpd.fifo
actually a folder, not a file?
Advertisement
/TThanks for all the details. Isn't the.proftpd.fifo
actually a folder, not a file?
option exclude .proftpd.fifo/
option exclude
is deprecated for years. You should use -filemask
switch instead:
synchronize -filemask=|.proftpd.fifo/ ...
Directory of \\backup\backup3 11-05-2020 18:53 <DIR> . 11-05-2020 12:13 <DIR> .. 11-05-2020 18:57 <DIR> .proftpd.fifo 14-05-2020 20:35 <DIR> Daily Backups 11-05-2020 12:18 <DIR> Old Backups 11-05-2020 12:37 <DIR> Test
synchronize -filemask=|.proftpd.fifo/;"Old Backups/";"Test/" remote "\\backup\backup3\" "/Daily Backups/"
synchronize remote "\\backup\backup3\Daily Backups\" "/Daily Backups/"
Advertisement
You can post new topics in this forum