Created
December 2, 2015 16:35
-
-
Save jorgedison/8d1ffa3d3ab9a8098c0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Echo Off | |
set _fecha=%DATE:~-4%_%DATE:~3,2%_%DATE:~0,2% | |
Set _FTPServerName= [IP] | |
Set _UserName=[USER_FTP] | |
Set _Password=[PASSWORD] | |
Set _LocalFolder=[RUTA_PC_LOCAL] | |
Set _RemoteFolder=[RUTA_SERVER_REMOTO] | |
Set _Filename=[NOMBRE_ARCHIVO]_%_fecha%.7z | |
Set _ScriptFile=ftp1.ftp | |
:: Create script | |
>"%_ScriptFile%" Echo open %_FTPServerName% | |
>>"%_ScriptFile%" Echo %_UserName% | |
>>"%_ScriptFile%" Echo %_Password% | |
>>"%_ScriptFile%" Echo lcd %_LocalFolder% | |
>>"%_ScriptFile%" Echo cd %_RemoteFolder% | |
>>"%_ScriptFile%" Echo dir | |
>>"%_ScriptFile%" Echo binary | |
>>"%_ScriptFile%" Echo mget %_Filename% | |
>>"%_ScriptFile%" Echo disconnect | |
>>"%_ScriptFile%" Echo quit | |
:: Run script | |
ftp -s:"%_ScriptFile%" | |
::Del "%_ScriptFile%" | |
ftp -i -s:ftp1.ftp | |
quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment