Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trace a script.

Status
Not open for further replies.

haneo

Programmer
Jan 2, 2002
274
CA
Hello,
I copy daily (with crontab) many files from our servers to my PC,
What I want is how to know if the files are copied whith success,
is there a way to know if an error has occured ?


for file in `ssh $REMOTE_SERVER ls /dir/[ab]*`
do
scp -Cr $REMOTE_SERVER:$file /tmpdir/
done



Best regards.


CCNA
 
capture errors for scp command
and compare file lengths before/after copy.
 
eg. cp file1 file2
sum file1
sum file2

The numbers from the sum output should match.

Martin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top