I have a batch file that I execute each day. It calls a FTP step to transfer some data from our host systems onto a local server for processing. The FTP step is utilizing a GET statement to transfer the data.
In my output file I would like to concatenate the current date to final output file name. This way it will assure that each day that this process runs the output files are name uniquely.
Current FTP GET statement....
get 'PWDOP.DMGJW.PR27DD01(-0)' "\\usgpdsm0nam02\group\OPPROCSN\Reports and Tools\CustomerShippedLines\ShippedLines.txt"
I would like the output filename to be ShippedLines-mmddccyy.txt verses the current ShippedLines.txt
Much appreciated to all the help.
Don
Concatenate Current Date in Batch Script FTP output filename
Moderator: DosItHelp
-
- Posts: 4
- Joined: 18 Dec 2009 07:59
Re: Concatenate Current Date in Batch Script FTP output file
!k suggested a possible way some days ago.
Regards
aGerman
Code: Select all
@echo off &setlocal
for /f "skip=1 delims=." %%d in ('WMIC OS Get LocalDateTime^|findstr .') do set "DT=%%d"
echo get 'PWDOP.DMGJW.PR27DD01(-0)' "\\usgpdsm0nam02\group\OPPROCSN\Reports and Tools\CustomerShippedLines\ShippedLines-%DT:~4,4%%DT:~,4%.txt"
pause
Regards
aGerman
Re: Concatenate Current Date in Batch Script FTP output file
How do i test to see if my FTP is working? I made a vsftpd server on my linux box and set up all the proper configurations and permissions for the /home/ftp directory... now i want to test it. Can i do this on my local machine?
Last edited by razeliex on 10 Apr 2011 04:29, edited 1 time in total.
Re: Concatenate Current Date in Batch Script FTP output file
Please open your own topic next time.
If you can address the server then you could test whether it works. Have a look at the FTP script examples.
Regards
aGerman
If you can address the server then you could test whether it works. Have a look at the FTP script examples.
Regards
aGerman