Comparing directories via ftp


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Comparing directories via ftp
# 1  
Old 03-20-2008
Comparing directories via ftp

Hello!

I am trying to compare a list of files in 2 directories - one on our unix server (I'll call it 'ours') and one on a site we ftp to (I'll call it 'ftp'). I need to make sure that after we ftp, the names that we put out there match the names we have on our side. I was thinking to create a textfile with the list of files in the directory on 'ours' and comparing it to a list of files on 'ftp'.

First part is easy:

for x in `ls *.*`
do
echo $x >> oursdir.txt
done

But does anyone know of a way to document a list of files from an ftp site so I can compare it with what's on our side that we sent?

Thanks in advance,
# 2  
Old 03-21-2008
I'm not sure what 'document a list of files' means but let's try this:

Code:
echo "
open nodename
user username password
cd /path/i/want
ls
bye
" | ftp -n > document_of_files.txt

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Comparing two directories with diff

Hi all, I have 2 directories on two different servers. I am trying to find out what is missing from directory X and what is missing from directory Y. they should both have the same exact files in them. I understand some files may be missing from both directories on each server. I am not sure... (8 Replies)
Discussion started by: jeffs42885
8 Replies

2. Shell Programming and Scripting

Comparing 2 UNIX directories

Hello, I'd want to compare the content of 2 directories in unix. I use the diff command like this: diff /home/user/AAAAA /home/user/BBBBB It works fine, but when a same file is in both directories and they are diferents, I'd want to see only that it is diferent and not all... (4 Replies)
Discussion started by: nolo41
4 Replies

3. Shell Programming and Scripting

Comparing the pattern of the file names in 2 different directories

Hi, I have got a requirement for which i need your help. The following problem is required to get solved in PERL SCRIPT. Here is the requirement. There are 4 folders say SRC_DIR1, SRC_DIR2 and TGT_DIR_1,TGT_DIR_2 (Note: both path of SRC_DIR1 & SRC_DIR2 are different but both path of... (4 Replies)
Discussion started by: shadow_fawkes
4 Replies

4. Shell Programming and Scripting

**URGENT ** : Comparing the pattern of the file names in 2 different directories

Hi, I have got a requirement for which i need your help. The following problem is required to get solved in PERL SCRIPT. Here is the requirement. There are 4 folders say SRC_DIR1, SRC_DIR2 and TGT_DIR_1,TGT_DIR_2 (Note: both path of SRC_DIR1 & SRC_DIR2 are different but both path of... (1 Reply)
Discussion started by: shadow_fawkes
1 Replies

5. Shell Programming and Scripting

Comparing the modified dates of files in two directories

Hi Is it possible to compare the modified dates of all the files in two directories using shell script? I would like to take a backup of a directory in production server regularly. Instead of copying all the files in the directory, is it possible to list only the files that are... (2 Replies)
Discussion started by: ashok.k
2 Replies

6. Homework & Coursework Questions

comparing 2 directories

i have been asked to write a bash shell script comparing two directories and sed or awk should not be used in this assignment. compdir will compare filenames in two directories, and list information about filenames that are in one directory but not the other. The information listed will be a long... (1 Reply)
Discussion started by: soccerball
1 Replies

7. Shell Programming and Scripting

Comparing directories on different unix servers

Is it possible to use the diff command to compare two directories on different Unix (AIX) servers? We have two regions set up and we want to be able to compare if the scripts directory in both regions contain the same files? I want to figure out if its possible.. Have been messing around by... (10 Replies)
Discussion started by: Jazmania
10 Replies

8. UNIX for Dummies Questions & Answers

FTP Directories

Hi Unix Gurus, Been trying to find a thread on this matter but somehow it's not related. I'm trying to ftp a few directories from Unix to the Wintel server but somehow its not working at all :( i've tried to use mput but mput is only working for files but not directory. any suggestion... (1 Reply)
Discussion started by: lweegp
1 Replies

9. UNIX for Advanced & Expert Users

ftp files with directories

hi, i am trying to ftp files from one server to another. how do i do it with all directories.(i mean i need the same directory structure) mget -r * doesnt seem to work properly..pls help. (5 Replies)
Discussion started by: dnat
5 Replies

10. UNIX for Dummies Questions & Answers

comparing the content of two directories

Hello I want to compare the content of two directories recursively to check if the two directories have the same files. How can I do that? (2 Replies)
Discussion started by: xyzt
2 Replies
Login or Register to Ask a Question