FTP 上传下载 bat

上传
@echo off


set ymd=%date:~0,4%%date:~5,2%%date:~8,2%


set ymd_t=%ymd%_%time:~0,2%%time:~3,2%%time:~6,2%
set ymd_t=%ymd_t: =0%
echo 运行开始时间:%ymd_t%>>%ymd%_upload_log.txt
::批处理代码
::::::::::::::::::::::


title ftp文件上传
echo open ip>%ymd%_upload_log.txt
echo username>>%ymd%_upload_log.txt
echo password>>%ymd%_upload_log.txt
echo bin>>%ymd%_upload_log.txt
echo cd /vgop/three_plat/data>>%ymd%_upload_log.txt
echo pwd>>%ymd%_upload_log.txt
echo put E:\zhzq\shell\ceshi.txt>>%ymd%_upload_log.txt
echo bye>>%ymd%_upload_log.txt
ftp -s:%ymd%_upload_log.txt
pause
::批处理代码
set ymd_t=%ymd%_%time:~0,2%%time:~3,2%%time:~6,2%
set ymd_t=%ymd_t: =0%
echo 运行结束时间:%ymd_t%>>%ymd%_upload_log.txt




pause


下载

@echo off

set ymd=%date:~0,4%%date:~5,2%%date:~8,2%

set ymd_t=%ymd%_%time:~0,2%%time:~3,2%%time:~6,2%
set ymd_t=%ymd_t: =0%
echo 运行开始时间:%ymd_t%>>%ymd%_download_log.txt
::批处理代码
::::::::::::::::::::::

title ftp文件下载
echo open ip>%ymd%_download_log.txt
echo username>>%ymd%_download_log.txt
echo password>>%ymd%_download_log.txt
echo bin>>%ymd%_download_log.txt
echo cd /vgop/three_plat/data>>%ymd%_download_log.txt

 
echo pwd>>%ymd%_download_log.txt
echo lcd E:\zhzq\shell>>%ymd%_download_log.txt
echo pwd>>%ymd%_download_log.txt
echo get ceshi.txt>>%ymd%_download_log.txt
echo bye>>%ymd%_download_log.txt
ftp -s:%ymd%_download_log.txt

::批处理代码
set ymd_t=%ymd%_%time:~0,2%%time:~3,2%%time:~6,2%
set ymd_t=%ymd_t: =0%
echo 运行结束时间:%ymd_t%>>%ymd%_download_log.txt


pause



你可能感兴趣的:(FTP 上传下载 bat)