The failed file transfer I have reported was run from the command prompt.
(running the windows batch file)
In production the scheduler runs the same windows batch file, and uses the Administrator account to start it, and runs it in a local directory.
here is the batch file in full:
rem
rem
rem ! we now run winscp to xxxFRU files
rem !
@Echo Off
>>xxxFRU_Logfile.txt 2>&1 now "Start xxx_get_fru"
if exist xxx_get_fru.txt del xxx_get_fru.txt
if exist c:\inetpub\ftproot\xxxfru\xfer_complete\complete.txt ^
del c:\inetpub\ftproot\xxxfru\xfer_complete\complete.txt
rem
rem create winscp script file
rem
echo option batch abort >> xxx_get_fru.txt
echo option confirm off >> xxx_get_fru.txt
echo open xxx/xxxfru >> xxx_get_fru.txt
echo ascii >> xxx_get_fru.txt
echo # >> xxx_get_fru.txt
echo # monthly files >> xxx_get_fru.txt
echo # >> xxx_get_fru.txt
echo lcd C:\Inetpub\ftproot\xxxFru\ >> xxx_get_fru.txt
echo cd /DMS/Outbound/FRU/ >> xxx_get_fru.txt
echo synchronize local -criteria=time >> xxx_get_fru.txt
echo # >> xxx_get_fru.txt
echo # full files >> xxx_get_fru.txt
echo # >> xxx_get_fru.txt
echo lcd C:\Inetpub\ftproot\xxxFru\FRUFULL >> xxx_get_fru.txt
echo cd /DMS/Outbound/FRU/FRUFULL >> xxx_get_fru.txt
echo synchronize local -criteria=time >> xxx_get_fru.txt
echo exit >> xxx_get_fru.txt
>>xxxFRU_Logfile.txt 2>&1 now "Run WinSCP xxxFRU "
winscp.com /script=xxx_get_fru.txt
rem !
if errorlevel 1 goto error1
rem
echo xxx FRU files download succeeded
>>xxxFRU_Logfile.txt 2>&1 now "End WinSCP xxxFRU success"
copy c:\ppk\complete.txt c:\inetpub\ftproot\xxxfru\xfer_complete
rem sender receiver subject message attachment
cscript sendmail.vbs "thomas.dreher@pentanasolutions.com" "thomas.dreher@pentanasolutions.com" "xxxFRU success" "please check logfile" "c:\ppk\xxxFRU_Logfile.txt"
goto exit1:
:error1
echo xxx FRU files Download failed
>>xxxFRU_Logfile.txt 2>&1 now "End WinSCP xxxBRU failed"
cscript sendmail.vbs "thomas.dreher@pentanasolutions.com" "thomas.dreher@pentanasolutions.com" "xxxFRU ERROR" "please chk logfile" "c:\ppk\xxxFRU_Logfile.txt"
:exit1
rem ! exit
(running the windows batch file)
In production the scheduler runs the same windows batch file, and uses the Administrator account to start it, and runs it in a local directory.
here is the batch file in full:
rem
rem
rem ! we now run winscp to xxxFRU files
rem !
@Echo Off
>>xxxFRU_Logfile.txt 2>&1 now "Start xxx_get_fru"
if exist xxx_get_fru.txt del xxx_get_fru.txt
if exist c:\inetpub\ftproot\xxxfru\xfer_complete\complete.txt ^
del c:\inetpub\ftproot\xxxfru\xfer_complete\complete.txt
rem
rem create winscp script file
rem
echo option batch abort >> xxx_get_fru.txt
echo option confirm off >> xxx_get_fru.txt
echo open xxx/xxxfru >> xxx_get_fru.txt
echo ascii >> xxx_get_fru.txt
echo # >> xxx_get_fru.txt
echo # monthly files >> xxx_get_fru.txt
echo # >> xxx_get_fru.txt
echo lcd C:\Inetpub\ftproot\xxxFru\ >> xxx_get_fru.txt
echo cd /DMS/Outbound/FRU/ >> xxx_get_fru.txt
echo synchronize local -criteria=time >> xxx_get_fru.txt
echo # >> xxx_get_fru.txt
echo # full files >> xxx_get_fru.txt
echo # >> xxx_get_fru.txt
echo lcd C:\Inetpub\ftproot\xxxFru\FRUFULL >> xxx_get_fru.txt
echo cd /DMS/Outbound/FRU/FRUFULL >> xxx_get_fru.txt
echo synchronize local -criteria=time >> xxx_get_fru.txt
echo exit >> xxx_get_fru.txt
>>xxxFRU_Logfile.txt 2>&1 now "Run WinSCP xxxFRU "
winscp.com /script=xxx_get_fru.txt
rem !
if errorlevel 1 goto error1
rem
echo xxx FRU files download succeeded
>>xxxFRU_Logfile.txt 2>&1 now "End WinSCP xxxFRU success"
copy c:\ppk\complete.txt c:\inetpub\ftproot\xxxfru\xfer_complete
rem sender receiver subject message attachment
cscript sendmail.vbs "thomas.dreher@pentanasolutions.com" "thomas.dreher@pentanasolutions.com" "xxxFRU success" "please check logfile" "c:\ppk\xxxFRU_Logfile.txt"
goto exit1:
:error1
echo xxx FRU files Download failed
>>xxxFRU_Logfile.txt 2>&1 now "End WinSCP xxxBRU failed"
cscript sendmail.vbs "thomas.dreher@pentanasolutions.com" "thomas.dreher@pentanasolutions.com" "xxxFRU ERROR" "please chk logfile" "c:\ppk\xxxFRU_Logfile.txt"
:exit1
rem ! exit