Hi Everyone,
I need your help.
I want to create a batch script that will get the specific latest file from linux and put that onto specified Windows directory:
I want simple code as much as possible
So far, I have this code:
1 lcd $DESTINATION_DIR
2 FTP #IP
3 #username
4 #password
5 cd $source_dir
6 ascii
7 get `ls latest*.csv | tail 1`
8 bye
But I got error in #7. I dont know if my idea is simple as this.. need your expertise
Thank you in advance.
FTP : Get the latest file from LINUX to Windows using Batch script
Moderator: DosItHelp
-
- Posts: 1
- Joined: 17 Jul 2016 18:26
Re: FTP : Get the latest file from LINUX to Windows using Batch script
miaka_1012 wrote:I want to create a batch script that will get the specific latest file from linux and put that onto specified Windows directory:
So far, I have this code:
1 lcd $DESTINATION_DIR
2 FTP #IP
3 #username
4 #password
5 cd $source_dir
6 ascii
7 get `ls latest*.csv | tail 1`
8 bye
But I got error in #7. I dont know if my idea is simple as this.. need your expertise
Your code is a mixture of batch files and FTP commands, but mostly FTP commands.
You're asking for the latest file but showing a filename called latest.
It would help if you give accurate details about the task - not password or username or URL though.
See here: viewtopic.php?f=3&t=6108