FTP to read a directory


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP to read a directory
# 1  
Old 08-21-2003
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
# 2  
Old 08-21-2003
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]*
# 3  
Old 08-25-2003
How to FTP Multiple Files and Directories

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
# 4  
Old 08-25-2003
use mget *.* to get all the files and folders and use mput to transfer the files to the remote location
# 5  
Old 08-25-2003
krishnamarajuc,

Bakary said that mget *.* is already what he uses ... the problem is that *.* returns unwanted/unneeded files.
# 6  
Old 08-25-2003
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"
# 7  
Old 08-25-2003
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replicate remote directory to local directory with ftp

I have system that generate files every 1 hours , i only have ftp connection from my local server to remote . $ ls -al -rw-r--r-- 1 water None 0 Feb 7 18:09 a.0800 -rw-r--r-- 1 water None 0 Feb 7 18:09 a.0900 -rw-r--r-- 1 water None 0 Feb 7 18:09 a.1000 is there any perl / php... (3 Replies)
Discussion started by: before4
3 Replies

2. UNIX for Dummies Questions & Answers

Ftp read a file

hi, i need ftp commands which read a text file and ftp the contents of the file to a another machine. Anyone can help me out please. (2 Replies)
Discussion started by: kamaldev
2 Replies

3. Shell Programming and Scripting

ftp whole directory

HI Guys, I have downloaded the oracle binaries from oracle.com, i have unziped them in a directory say OWB. I have to copy them to my windows server so i have ran the ftp command. It looks like i can ftp whole directory. Can you please get me the command to get all the files and... (7 Replies)
Discussion started by: guddu_12
7 Replies

4. AIX

AIX - read only FTP

Hi, I want to set FTP server on AIX to read only mode. I found out manual page for /etc/ftpaccess.ctl (manual page ). I tried put readonly: ALL or readonly: ALL writeonly: NONE and nothing happened (of course, I restart FTP server by stopsrc -t ftp; startsrc -t ftp) (2 Replies)
Discussion started by: henriette
2 Replies

5. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

6. Solaris

add a ftp user with read and write permissions on a directory

hi all how I can create an ftp user in solaris 10 and have read and write permission on a directory. Thanks. (1 Reply)
Discussion started by: luisfja
1 Replies

7. UNIX for Dummies Questions & Answers

Read Files from a Directory

Hi, I have a requirement where I have get the files from FTP server then delete the files in the FTP server and then store the file name within the file where there is "TR". i.e Filename|TR|20071231|.... Once I finish loading my file I have to archive the files. Is there any way to do it... (2 Replies)
Discussion started by: kiran_418
2 Replies

8. UNIX for Dummies Questions & Answers

can we ftp a directory

Hi guyz, Is there any way to ftp a whole directory structure. I mean is there any way using which I can get the whole directory ftpied including the subdirectories Thanks and regards, Gauravv (17 Replies)
Discussion started by: gauravgoel
17 Replies

9. UNIX for Dummies Questions & Answers

ftp a directory

How does one ftp an entire directory from one Solaris 5.9 machine to another with out moving one file at a time? (4 Replies)
Discussion started by: DarkLord
4 Replies

10. UNIX for Dummies Questions & Answers

ftp-directory

Some users get on our server with ftp with a specific username (i.e. guest). The users guest has an own group. The user guest is in the path /usr/guests after login. How can I lock the user guest that he don't get up to the /usr treee. I tried to change the rights for the .. But it's not anymore... (1 Reply)
Discussion started by: arn_ch
1 Replies
Login or Register to Ask a Question