- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- usage of cksum
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 08:55 AM
01-17-2002 08:55 AM
I need your help in a script.
The existing script looks for a directory and if there are any files present then 'rcp' it over to the remote server and mv the the same file to a local 'done' directory. If by any reason rcp was not successful we have no clue if the file has transmitted fully before it move it to the done directory.
I came to know about sum /cksum command to verify the data integrity of the file.
I would like to insert this cksum within script to ensure successful rcp.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 09:25 AM
01-17-2002 09:25 AM
Re: usage of cksum
in ksh:
$filesumremote=`remsh hostwherefilewent cksum filepath_of_file_onremotehost`
$filesumlocal=`cksum filepath`
Then compare the two results.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 09:32 AM
01-17-2002 09:32 AM
Re: usage of cksum
What is the result I'll get for sucessful and unsucessful file transfer..?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 09:55 AM
01-17-2002 09:55 AM
Re: usage of cksum
Try this.
rcp
REMOTE=`remsh
LOCAL=`/usr/bin/cksum
echo $REMOTE $LOCAL
if [ $LOCAL=$REMOTE ]
then
echo "Transfer OK"
else
echo "Transfer Not OK"
fi
HTH
Prashant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 09:58 AM
01-17-2002 09:58 AM
Re: usage of cksum
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 09:59 AM
01-17-2002 09:59 AM
Re: usage of cksum
How do I than ask the script to retransmit the file if it's "Not OK"
I'm very new to this scripting..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 10:11 AM
01-17-2002 10:11 AM
Re: usage of cksum
#!/bin/ksh
file1=`cksum /tmp/hello|cut -d" " -f1,2`
file2=`remsh vpart2 cksum /tmp/hello|cut -d" " -f1,2`
echo $file1 "---" $file2
if [ "${file1}" != "${file2}" ];then
echo panic - files do not match
echo do some import stuff here
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 10:20 AM
01-17-2002 10:20 AM
SolutionYou can put in a loop if you like.
while true
do
rcp
REMOTE=`remsh
LOCAL=`/usr/bin/cksum
echo $REMOTE $LOCAL
if [ $LOCAL=$REMOTE ]
then
echo "Transfer OK"
break
else
echo "Transfer Not OK, Trying again."
echo "Transfer of local file not OK" |sendmail SYSADMIN
fi
#--
I personally feel If transfer not ok, page to sysadmin, in stead on looping.
HTH
Prashant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2002 10:33 AM
01-17-2002 10:33 AM
Re: usage of cksum
One other thing, in case you haven't thought of it yet, is to verify the source file is not in use (busy). It would be if still being written. I used:
InUse=`fuser filename 2>/dev/null`
if [ X"$InUse" = X ]
then
echo not in use
else
echo in use
fi
Darrell