transfering file using FTP commands

  • Thread starter Thread starter pandurang
  • Start date Start date
P

pandurang

Guest
hi,

i am writing script to transfer files from FTP server using inbuilt FTP
utility commands.On FTP server files that i want to copy resides in a folder
with the name as 100308 it is 3rd October 2008(mmddyy) so can you tell me how
to get the Date of FTP server and extract the month,date and year from the
system date so that i will create a string by concatenating month,date and
year and will copy the whole folder that will match with the string. I was
not able to find the date command in FTP.
i also need to extract the minutes and hours from the date using FTP command.
Do we need to change to the shell of the FTP server and get the date.

Also can i copy the whole folder using FTP commands??? if not what should i
use to copy the whole folder???
 
Re: transfering file using FTP commands

pandurang <pandurang@discussions.microsoft.com> wrote:

>i am writing script to transfer files from FTP server using inbuilt FTP
>utility commands.On FTP server files that i want to copy resides in a folder
>with the name as 100308 it is 3rd October 2008(mmddyy) so can you tell me how
>to get the Date of FTP server and extract the month,date and year from the
>system date so that i will create a string by concatenating month,date and
>year and will copy the whole folder that will match with the string. I was
>not able to find the date command in FTP.


I think you'd have to run some process that would build your FTP
command script dynamically. It could be C, C++, Perl, whatever you're
comfortable with. (I'm not sure a shell script - *.bat or *.cmd file -
can manipulate strings like that.) The process would construct the
directory name, then use that to write the FTP command file, then
invoke FTP.

>i also need to extract the minutes and hours from the date using FTP command.
>Do we need to change to the shell of the FTP server and get the date.


I think your stuck there, as long as you're using FTP. I don't think
you can "shell out" to the server.

>Also can i copy the whole folder using FTP commands??? if not what should i
>use to copy the whole folder???


Once you CD into the directory, you can use the MGET command to get
all the files.

--
Tim Slattery
MS MVP(Shell/User)
Slattery_T@bls.gov
http://members.cox.net/slatteryt
 
Back
Top