Upload files to "/"
This commit is contained in:
commit
c534929b81
41
ftpgls.bat
Normal file
41
ftpgls.bat
Normal file
@ -0,0 +1,41 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
REM Define paths
|
||||
set "winscpPath=C:\Program Files (x86)\WinSCP\WinSCP.com"
|
||||
set "logFile=%~dp0ftp_upload.log"
|
||||
set "winscpScript=%~dp0winscp_script.txt"
|
||||
set "localDir=C:\zucchetti\E80_SL\SPEDGLS"
|
||||
set "backupDir=C:\zucchetti\E80_SL\backgls_test"
|
||||
|
||||
REM Start logging
|
||||
echo =============================== >> "%logFile%"
|
||||
echo Starting FTP upload with WinSCP: %date% %time% >> "%logFile%"
|
||||
|
||||
REM Run WinSCP with the script file and log the output
|
||||
"%winscpPath%" /script="%winscpScript%"
|
||||
|
||||
REM Check for errors in WinSCP execution
|
||||
if errorlevel 1 (
|
||||
echo Error during FTP upload, check log for details. >> "%logFile%"
|
||||
echo Process aborted. >> "%logFile%"
|
||||
goto end
|
||||
)
|
||||
|
||||
REM Move files to local backup directory
|
||||
echo Moving files to backup directory: %backupDir% >> "%logFile%"
|
||||
for %%f in ("%localDir%\*") do (
|
||||
if exist "%%f" (
|
||||
move "%%f" "%backupDir%" >> "%logFile%" 2>&1
|
||||
echo Moved %%~nf to backup at %time% >> "%logFile%"
|
||||
) else (
|
||||
echo File %%~nf not found during move. >> "%logFile%"
|
||||
)
|
||||
)
|
||||
|
||||
REM End logging
|
||||
:end
|
||||
echo FTP upload and backup process completed at %date% %time%. >> "%logFile%"
|
||||
echo =============================== >> "%logFile%"
|
||||
endlocal
|
||||
|
||||
6
winscp_script.txt
Normal file
6
winscp_script.txt
Normal file
@ -0,0 +1,6 @@
|
||||
open ftp://sacchettifo8378:de2pR4td@ftp.gls-italy.com -passive=on
|
||||
lcd C:\zucchetti\E80_SL\SPEDGLS
|
||||
cd /
|
||||
put *.*
|
||||
close
|
||||
exit
|
||||
Loading…
Reference in New Issue
Block a user