Solved

Best method to verify unix cp command was successful

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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.:
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.

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now