Solved

Best method to verify unix cp command was successful

Posted on 2008-06-23
1
1,871 Views
Last Modified: 2013-12-27
In database environment need to absolutely verify that cold backup files are saved to alternative location.  I have approximately 20 files that are 2GB each.  My only thought is to use the unix "cmp" command to verify files have been copied successfully ( e.g. source matches copy byte for byte ).  What about running a checksum, unix command "sum"?
0
Comment
Question by:sdruss
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 21852373

#!/bin/sh
src_sum=`sum /src/file | awk '{print $1]'`
dst_sum=`sum /dst/file | awk '{print $1}'`
 
if [ $src -eq $dst ]
then
   echo "Checksums are the same"
else
   echo "Checksums differ"
fi

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

736 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question