Check files copied from remote server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Check files copied from remote server
# 1  
Old 02-09-2012
Check files copied from remote server

There is a process which copy files form unix a to unix b
I would like to check whether all files copied from a to b or not ,and list which are the missing files.
Is there a command to check like that
# 2  
Old 02-09-2012
You can do it several ways

Code:
ftp -n <<EOF > check.dat
open remotenode
USER username
PASS passwd
cd /remotedir
ls
bye
EOF

if you have ssh keys installed
Code:
ssh remotenode 'ls -l /path/to/remotefiles'

# 3  
Old 02-09-2012
Actually i need to check this is shell script , not manually

Last edited by lalitpct; 02-09-2012 at 12:28 AM.. Reason: spell mistake
# 4  
Old 02-09-2012
1> Assume both files reside on remote m/c

# ssh user@192.168.8.20 diff -rq dir1 dir2

2> You can use rsync too
rsync -avn src-dir/ tar-dir/

3>Lsit colliding filenames
diff -sq dir1 dir2 | grep -v "Only in"

--Shirish
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. Shell Programming and Scripting

How can I check, if on remote server directory is empty or have files?

I have a script, which is supposed to run 1 day of the month, connect to remote server certain directory, find files, tar the, and copy find . -ctime -1 | tar -cvf transfer_dmz_start_monthly.tar *${Today}*.*; if then echo "Cannot create a tar file, the terminated... (2 Replies)
Discussion started by: digioleg54
2 Replies

3. Shell Programming and Scripting

Checking integrity copied from remote server using UNIX command

I am getting a file (abc.txt) using scp from remote server. scp <connect string> -i $HOME/.ssh/id_dsa rem_id@hostname:/var/prod/abc.txt /var/prod/abc.out Before loading I need to check if the file is indeed same , for that I thought of checking the line count but when I used ssh command it was... (3 Replies)
Discussion started by: lalitpct
3 Replies

4. Shell Programming and Scripting

File Check in remote server

Hi Experts, I need a script in which I need to scp a file /home/chandan/abc.txt to a remote server using scp. Then I need to check whether scp is successful or not. How am I going to write this code? My Server Name: myserver File Name On My Server: /home/chandan/abc.txt Destination Server... (3 Replies)
Discussion started by: ChandanN
3 Replies

5. Shell Programming and Scripting

How to get user to choose files to be copied to FTP server?

Hey all. I'm writing a script to automatically login to a router, change directories to where crashfiles are located, then listing all files in that directory. This is where I'm at so far and wish to have some user interaction to choose the files. What I am trying to do is list the files and get... (1 Reply)
Discussion started by: Gouda
1 Replies

6. Red Hat

Files copied to FTP server not shown

I had copied 2 files to an FTP server which I deployed on my RHEL 5.8 server. The ownership I kept for the files are for the user, ftp. But, I do not see the files on the FTP location using either accessing through Windows explorer or the browser. The ftp location is ftp://10.101.17.80/incoming.... (7 Replies)
Discussion started by: RHCE
7 Replies

7. Shell Programming and Scripting

to check if a remote server is up

I need to check if a remote server is up before i send a file to it through FTP. I thought of using "ping" command to check it. But the problem is, my script needs to run from 2 different servers, one is Solaris and other is HP-UX. And ping works in different way in each of them when I do -... (3 Replies)
Discussion started by: Vidhyaprakash
3 Replies

8. Shell Programming and Scripting

preserving the timestamp of a file when copied from remote server to local server using ftp

Hi, I need to copy few files from remote server to local server. I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed. ... (5 Replies)
Discussion started by: arunkumarmc
5 Replies

9. Shell Programming and Scripting

How to check the file status in a remote server?

Hi All, Thanks in Advance. My requirement is there are some data files to be updated(some times new files get created) regularly in server A, these files are to be updated to the server B(backup server) by using SCP, I have to write a script for this purpose, before copying the files to server... (3 Replies)
Discussion started by: rajus19
3 Replies
Login or Register to Ask a Question