[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Best method to verify unix cp command was successful

Posted on 2008-06-23
1
Medium Priority
?
1,882 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 1000 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

Industry Leaders: 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

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
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 several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.
Suggested Courses

649 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