@MAXOHDA: Please start a new topic and post a log file.
- martin
synchronize local -transfer=binary -filemask=>1K "E:\Backup\SxHotSrv\Documents\"
A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied.
П(р)ервать, П(о)вторить, (П)ропустить, Пропустить (в)се: Пропустить
5dd1fcc9-102e-11ed-80d5-0 | 147 KB | 15,4 KB/s | binary | 100%
5dd880e1-c1da-11ec-80d4-0 | 0 B | 15,4 KB/s | binary | 0%
WinSCP.com
anywhere.
REM syncing to z: drive
cd "c:\Program Files\OpenVPN\bin"
REM Step1: Connect to VPN
openvpn-gui --connect "mdex fixed.IP20 TCP.ovpn" --config_dir "c:\Program Files\OpenVPN\config" --silent_connection 1
"open ftp://xxxx_abc:xxxxxxx@172.xx.x.xx:xxxxx" ^
"synchronize local -filemask=*.* -neweronly "server_mirror\" ""/Raw/"" " ^
"close" ^
"exit"
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo WinSCP finished:Success
) else (
echo Error
)
REM Step3- Disconnect openVPN
"c:\Program Files\OpenVPN\bin\openvpn-gui.exe" --command disconnect_all
REM Step 4- Copy newer files to a to_convert folder, delete 0kB files
rmdir "Path"
-filemask=““*>60D““...
synchronize
command, as none of them are needed:
"synchronize local -filemask=*>60D z:\Projekte\109797-TestfeldBHV\30_Technical_execution_Confidential\TP3\AP2_Aufbau_Infrastruktur\Infrastruktur_Windmessung\02_Equipment\01_Wartung_Messmast_GE-NET_DWG_20190226\Data\UpgradeData\ /Intenso/LoggerRaw/" ^
REM Step2: Connect to FTP and synchronise all the files
"C:\Users\giyash\AppData\Local\Programs\WinSCP\WinSCP.com" ^
/log="z:\Projekte\109797-TestfeldBHV\30_Technical_execution_Confidential\TP3\AP2_Aufbau_Infrastruktur\Infrastruktur_Windmessung\02_Equipment\01_Wartung_Messmast_GE-NET_DWG_20190226\Data\UpgradeData\sync_Metmast_upgrade.log" /loglevel=-1 /logsize=5*10M /ini=nul ^
/command ^
"open ftp://iwes_bhv:iwes2020#@172.25.5.231:48489" ^
"synchronize local -filemask="*>60D" "z:\Projekte\109797-TestfeldBHV\30_Technical_execution_Confidential\TP3\AP2_Aufbau_Infrastruktur\Infrastruktur_Windmessung\02_Equipment\01_Wartung_Messmast_GE-NET_DWG_20190226\Data\UpgradeData\" ""/Intenso/LoggerRaw/"" " ^
"exit"
*.*
it works, but synchronises the whole folder, which I want to restrict to 60 days for example.
-rawtransfersettings
. Make sure you use the latest version of WinSCP. If this does not help, please post a session log file, not the XML log.
synchronise
command, but I could not get it to work that way. See below
open %CONN_SFTP_SVR%
option batch abort
cd %REMOTE_DIR2%
lcd %LOCAL_DIR2%
synchronize -rawtransfersettings ExcludeEmptyDirectories=1 -filemask=*.xml>=15N local
<?xml version="1.0" encoding="UTF-8"?>
<session xmlns="http://winscp.net/schema/session/1.0" name="tleacy@10.147.21.34 -hostkey=*" start="2020-12-11T09:48:14.646Z">
<failure>
<message>Unknown option 'ExcludeEmptyDirectories=1'.</message>
</failure>
</session>
open %CONN_SFTP_SVR%
option batch abort
get -rawtransfersettings ExcludeEmptyDirectories=1 -filemask=*.xml>=15N %LOCAL_DIR2% %REMOTE_DIR2%
<?xml version="1.0" encoding="UTF-8"?>
<session xmlns="http://winscp.net/schema/session/1.0" name="tleacy@10.147.21.34 -hostkey=*" start="2020-12-11T11:26:16.740Z">
<failure>
<message>Can't get attributes of file 'ExcludeEmptyDirectories=1'.</message>
<message>File or folder 'ExcludeEmptyDirectories=1' does not exist.</message>
</failure>
</session>
-rawtransfersettings
is a parameter of the synchronize
command, not of the open
command.
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set datestamp=%YYYY%%MM%%DD%
set CONN_SFTP_SVR="ftp://user:password!@10.10.10.10 hostkey=* -rawtransfersettings ExcludeEmptyDirectories=1"
::::::I tried the '-rawtransfersettings ExcludEmptyDirectories=1' here, but I am not sure how to include this?:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
set LOCAL_DIR1="D:\A\B\C\D\E\"
set LOCAL_DIR2=""D:\A\B\C\D\A1\"
set LOCAL_DIR3=""D:\A\B\C\D\A2\"
set LOCAL_DIR4=""D:\A\B\C\D\A3\"
set REMOTE_DIR1="D:\A\B\C\D\E\"
set REMOTE_DIR2=""D:\A\B\C\D\A1\"
set REMOTE_DIR3=""D:\A\B\C\D\A2\"
set REMOTE_DIR4=""D:\A\B\C\D\A3\"
set file_pattern=*%datestamp%*statsfile.xml
"C:\Program Files (x86)\WinSCP\WinSCP.exe" /xmllog=D:\Logs\!Y!M!D_!T_LOGS.xml
"/script=D:\LOACTION\TheCommands.txt"
###################################This is my transfer#######################
##A new file arrives on the remote server every 15 minutes and I wan to collect the most recent one. I use >15N but maybe there is a better way?########
open %CONN_SFTP_SVR%
option batch abort
######Example of dir 2 only##########
synchronize local -filemask=%file_pattern%>=15N %LOCAL_DIR2% %REMOTE_DIR2%
close