Copying dir (and sub dir) file names from ftp server to txt file in diff server


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Copying dir (and sub dir) file names from ftp server to txt file in diff server
# 1  
Old 12-23-2009
Copying dir (and sub dir) file names from ftp server to txt file in diff server

Hey all,

i want to copy only the file names from an ftp server (directory and all sub directory) to a text file in another server (non ftp), i.e. i want to recursively move through directories and copy only the names to a text file.
any help is appreciated...thank you in advance
# 2  
Old 12-23-2009
well, my recommendation is to create the directory, sub-directory listing on the ftp server ( is it Windows or UNIX ) and then ftp that file over, don't try to use ftp to create it.

on UNIX:

Code:
find $dir_of_interest -print > ftp_list.txt

on Windows: ( DOS batch file )

just plain ol'

Code:
DIR /S > some_text_file.txt

should be good enough to get you what you need.

for dos, even better ( for creating just a listing ) is:
Code:
xcopy THIS_DIR SOME_OTHER_DIR /L /E > C:\listing.txt


Last edited by quirkasaurus; 12-23-2009 at 12:15 PM.. Reason: adding another command
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

List the file names available on FTP server before selecting the required file

Below is my script code.which shows the environment name and then fetch the file from the ftp server but I am facing one issue.The script should be run in both way.We can pass the arguments with script and select the environment name then file name.Here the issue is I am not able to list the files... (1 Reply)
Discussion started by: anuragpgtgerman
1 Replies

2. Shell Programming and Scripting

Renaming File Names in a folder/Dir

Hi Team, I'm new to Unix shell scripting . I've the following requirement A folder contains the list of files with the following format ab.name.11.first ab.name.12.second ab.name.13.third ---------- I have to rename the above file to like below ... (6 Replies)
Discussion started by: smile689
6 Replies

3. UNIX for Dummies Questions & Answers

copying the dir/subdir structure from one server to another?

Hi All, I want to copy the dir/subdir structure from SERVER-A to SERVER-B without copying all the files in each dir. Is it possible using SCP / SFTP command? For example, SERVER-A has following two dir/subdirectories and files under each subdir. ... (1 Reply)
Discussion started by: Hangman2
1 Replies

4. Shell Programming and Scripting

Create file Dir and Sub Dir same time

Hi Guys , I want create files Dire and Sub Dire. as same time using variable. EX: x1="/hk/Pt/put/NC/R1.txt" x2="/hk/pt/Put/Ot/NC/RN.txt" And i want delete all after done with my script. Thanks (2 Replies)
Discussion started by: pareshkp
2 Replies

5. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

6. Shell Programming and Scripting

Moving file(s) from dir to dir

Hi, I am fairly new to writing scripts. I am trying to write a script that moves either One or All of the files from one directory to another. I know how to make the actual command to do it, but i don't quite know how to add operators to it, ie -i or -a. I want -i to move one file from... (4 Replies)
Discussion started by: SirJoeh
4 Replies

7. Shell Programming and Scripting

copying a file from one dir to another dir

hi i have a script compareFiles() { find /tmp/Satya -type f | \ while read filename1 do echo "----------------------------------------$filename1" find /tmp/Satya -type f | \ while read filename2 do if diff $filename1 $filename2 then echo "Both files... (3 Replies)
Discussion started by: Satyak
3 Replies

8. UNIX for Dummies Questions & Answers

How to copy the dir from one server to other

Hi, i am new to unix os. i have an existing unix(AIX) server in which we hav /usr1. now my task is to copy (EXACTLY) all the dir/sub-dir, including the owners/groups/users as well into the new Unix (AIX) servers. there are 8 dir in /usr1. but there are bunch of sub-dir/.. with diff... (1 Reply)
Discussion started by: krishnadvn
1 Replies

9. UNIX for Advanced & Expert Users

Recursively check the file/dir names

Hi, ' recgrep find . | xargs grep ' is used to scan the contents recursively. I have a different requirement. I need to scan just the names and check for a pattern and display with fullpath. Is that already available? Closest that I am trying is 'ls -R | grep pattern' Here I would get multiple... (1 Reply)
Discussion started by: eagercyber
1 Replies

10. Shell Programming and Scripting

To get the dir list of a remote server

Dear all; I am new to UNIX scripting and I want to download remote server's dir listing every hour, to check whether it is updating. How can I do this. can I use ftp command to down load this dir listing. Pls help me in this regards. tks (1 Reply)
Discussion started by: HMS.Chandrasiri
1 Replies
Login or Register to Ask a Question