FTP to read a directory

help needed !
I have an ftp script that read a directory for files with the *.*,
problem is now that it returns a lot and now i will like to limit the data to get by only selecting the required files.
All the files have and extension with the year date
eg. bb039519.233. the .233 is the date of the year and every new day, this is increasing by 1
can someone help me how i can handel this.
Thanks a lot.
Bakary

I'm assuming that the beginning part of the file name (bb039519) stays the same. The part after the decimal point is the julian date.

So right now you type mget *.* to retrieve your files?

If I'm following you, you need to type something like:
mget bb039519.[0-9]*

Hi,
I am trying to FTP multiple files and directory's using shell commands , do you have a script that can send all folders and files within a directory to a remote location.

Thanks

Trips

use mget *.* to get all the files and folders and use mput to transfer the files to the remote location

krishnamarajuc,

Bakary said that mget *.* is already what he uses ... the problem is that *.* returns unwanted/unneeded files.

If you want to transfer filetered files then you can use regular expressions to filter and list the directories/files under that directory, for eg. to transfer only the .DAT files use something like
" mget *.DAT"

It looks to me like this actually is a date calculation question. He posted on Aug 21, 2003 and said that he wanted filename.n where n was 233. By that numbering scheme, Jan 1, 2003 would be 1 while Dec 31, 2003 would be 365. But next year is a leap year, so Dec 31, 2004 would be 366.

Calculations like that are easy if you use my datecalc script which is right here. You can use the -j option to calculate julian day numbers. "datecalc -j 2002 12 31" will return 52639. And "datecalc -j 2003 8 21" will return 52872. And 52872 - 52639 = 233.

Hi Perderabo,
Thanks for your script, i will look at it and let you know but it seems that it may solve my problem.
I will be using this in an ftp script to get from a list of many files which all have julian date extension.
I will keep you all inform and thanx for the help !

Hi,
I tried to use mget *.* to pull all directories and files but this command is only picking up all files in the directory not the sub directory's , is there a diff way to use this command or am i making a dumb mistake.

All help would be greatly appreciated.

Regards

trips

No, you're not making a mistake. There are some other posts addressing this issue. Here's a couple:

However, the man page for ftp says: "Note: mget and mput are not meant to transfer entire directory subtrees of files."

There are two solutions mentioned in
Recursive FTP -- here at last.

Could I make a suggestion of using rsync.