Hello,
I have 3 folders on FTP server in the format yyyymmddhhmiss
as below,
ftp> cd /home/walgreens
250 CWD command successful
ftp> ls
200 PORT command successful
150 Opening ASCII mode data connection for file list
20150708072901
20150708092901
20150708102901
The above folders are in the format on FTP is YYYYMMDDHHMiSS
.
ftp> dir
200 PORT command successful
150 Opening ASCII mode data connection for file list
drwxrwxr-x 2 root root 4096 Jul 8 07:53 20150708072901
drwxrwxr-x 2 root root 4096 Jul 8 09:53 20150708092901
drwxrwxr-x 2 root root 4096 Jul 8 10:53 20150708102901
226 Transfer complete
The script needs to select the FTP folder 20150708102901
, since this is the latest one (arrived at 10am).
The script has to select the folder 20150708102901
and fetch the gz file inside it.
ftp> cd 20150708102901
250 CWD command successful
ftp> get CA.gz
Thanks
pavan