11-10-2010
Quote:
Originally Posted by
dlam
Obviously I could use the exit code to confirm the copy completed successfully but I assume that it wouldn't know if any data was lost.
Of course it would! Actually this is what the so-called "flow control" of the network layer is for - make sure that no packet is lost or at least make sure such a loss is noticed.
If you do some "scp /file/here user@host:/file/there" and it comes back with RC=0 you are guaranteed that the transmission was: 1) successful; 2) complete.
Quote:
Originally Posted by
dlam
The option I've thought of is to do a checksum on the file being copied, and do a remote checksum once the copy is completed and compare the two. But was just wondering if anyone could think of a neater way of doing it.
If you are really paranoid (which is, btw., a fitting attitude for a systems administrator and there is absolutely nothing wrong about it) you could of course check the checksums of both the local file and the remote copy.
There is a freeway utility called "md5sum" (download
here), which is included in many Linux distributions. Perhaps it can be compiled for most other Unix systems too. It should be well suited for your purpose.
I hope this helps.
bakunin
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I facing a problem with Unix command "rcp". I unable to perform a rcp between host machines. I have religiously followed the man pages, but still unable to solve the problem. Do i check for anything to perform this command? Pls help....thanks =) (3 Replies)
Discussion started by: lchunl
3 Replies
2. HP-UX
I want to copy dump generated from oracle database to my local DAT drive. Currently I am copying remote file to local drive thru rcp command and later copy it to local DAT. Pls. help me in this.
Thanks
Man Mohan
email address removed (8 Replies)
Discussion started by: manmohan73
8 Replies
3. Shell Programming and Scripting
Hi All,
Has been a while since I was last on, so I hope everyone has been doing fine. ;)
Would like to know if the below IF statement syntax is correct for a ksh environment. It's been pushed into live as someone had deleted the development copy(!); not withstanding that, the statement now... (3 Replies)
Discussion started by: Cameron
3 Replies
4. UNIX for Dummies Questions & Answers
Don't know if its correct to write into this topic but how can I copy files from a Windows machine to a UNIX system? (2 Replies)
Discussion started by: agasamapetilon
2 Replies
5. AIX
Guy's
I'm trying to create script to execute some critical commands in AIX
like the below ...
stopsrc -s qdaemon
stopsrc -s sshd
stopsrc -s lpd
stopsrc -s nfsd
I want between each command to ask me like this
" are you sure to stop qdaemon "
" are you sure to stop ssh"
" are... (3 Replies)
Discussion started by: Mr.AIX
3 Replies
6. Shell Programming and Scripting
Hi All,
My first post on the Forums! I've just whipped up a quick script to slightly automate a log file retrieval process for work and to be completely honest my BASH scirpting knownledge is extremely limited as is my understanding of a lot of linux commands.
Basically the scripts purpose... (3 Replies)
Discussion started by: effektd
3 Replies
7. UNIX for Advanced & Expert Users
I'm looking to use rsync to compare remote files and to copy the diff to a local directory, rather than transfer over the net.
The net connection is not fast enough to transfer these files (~1.8TB) and I'd like to sneakernet them instead.
Possible? (4 Replies)
Discussion started by: dfbills
4 Replies
8. Shell Programming and Scripting
Hi Guys,
I have files that are sent to me in this format:
Copy of USer Database updated 23 JANUARY 2013.csv
I am developing a script to load these files to my database automatically whenever I get these files:
How do I verify these files in an if statement if I do have these files?
... (5 Replies)
Discussion started by: Phuti
5 Replies
9. UNIX for Dummies Questions & Answers
I am using RedHat 4.4 Version Operating System.
I want to copy one file from source to destination.I don't want to give a password when I am executing the below shell script.
code:
#!/bin/bash
scp -r file.zip 192.168.1.5:/root/
Here it asking a password to enter,Is there any way give a... (2 Replies)
Discussion started by: kannansoft1985
2 Replies
10. Shell Programming and Scripting
Hi
I need a advice for writing simple bash script,
I have a file pod.txt which contains source location and remote location:
/mnt/infile/20141103/701_0001.png/remote/tmp/pk21730/p0330223723074.png
/mnt/infile/20141103/203_0001.png/remote/tmp/pk21731/p0330223723081.png
and I must copy ... (6 Replies)
Discussion started by: primo102
6 Replies
cmcp(1m) cmcp(1m)
NAME
cmcp - Copy files between Serviceguard nodes
SYNOPSIS
cmcp [-rv] [src_node:]src_file [...] [dest_node:]dest_file
DESCRIPTION
cmcp copies files and/or directories between Serviceguard nodes.
cmcp is limited in several ways. cmcp is best suited for situations where other remote copy facilities are not available. For a more full
featured tool for copying files between Serviceguard nodes, see ccp(1m) provided by Distributed Systems Administration Utilities.
To use this command, the local user must have the root access role on each of the involved nodes. For more information on Serviceguard
access control policies, see the manual, Managing Serviceguard.
Paths may be relative to the current working directory or specified absolutely. The current working directory on a remote node is assumed
to be the same as the local node's directory. Copies between two remote hosts are permitted.
If a file or directory already exists on the destination node, the destination node's copy will be overwritten with no prompting.
The cmcp command is not suited for large files or large numbers of files and may result in a heavy load on the command and Serviceguard
daemons. Other tools such as ccp should be considered for these purposes.
Options And Arguments
-r Recursively copy entire directories.
-v Verbose output will be displayed.
src_node
Serviceguard node to retrieve the file from. Defaults to the local node.
src_file
Path to source file on src_node.
dest_node
Serviceguard node to copy file to. Defaults to the local node.
dest_file
Path to copy src_file to on the dest_node.
RETURN VALUE
cmcp returns the following values:
0 Successful completion.
1 Command failed.
EXAMPLES
Copy the local file /etc/hosts to remote node node1
cmcp /etc/hosts node1:/etc/hosts
Copy the remote file /etc/passwd on node1 locally
cmcp node1:/etc/passwd /tmp/passwd.poe
Copy a local script directory to a remote node
cmcp -r /etc/cmcluster/scripts node1:/etc/cmcluster
AUTHOR
cmcp was developed by HP.
SEE ALSO
rcp(1), scp(1), ccp(1m), cmsync(1m), cmexec(1m), cmdo(1m), cmquerycl(1m), cmviewcl(1m)
Requires Optional Serviceguard Software cmcp(1m)