Solved

Best method to verify unix cp command was successful

Posted on 2008-06-23
1
1,866 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
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert curl speed_dwonload to Mbps 29 115
problem creating new luks volume on new VM disk 5 92
unix solaris snoop command 6 99
AWS CLI - Instances, Volumes & Tagging 2 94
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

778 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