02-07-2008
Not too much info here.
We need to know how big the source file was and how big the destination files was. And we need to know exactly how you obtained what you think is the file size. I think the most probable answer is that you have a bug your script. Even if your script transfered the file correctly, deleting the source file and then checking to see if the destination file is ok seems backwards.
If the file sizes really are different, I would expect the destination file to be smaller. This would mean that the transfer did not complete and would probably be caused by one of the boxes involved in the transfer rebooting or something like that. Or maybe you ran out of disk space. Stuff like this is the only way I have scp partially transfer a file but ultimately fail.
Also, files have two sizes: how much data is stored and how much disk space was used to store it. Minor changes in the second metric can be caused by using differing file systems. A one byte file could consume 4k of disk space on one box but only 1k of disk space on another. This does not indicate a problem in the transfer. This is why we need to know what numbers you are comparing.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All:
I'm having a problem with transferring files from a CD to my AIX machine. I don't know if I am using the mount command properly. My problem is that when I take a CD that I have burned on my PC over to my AIX machine, whent the CD is mounted the file names have been changed (a more thorough... (3 Replies)
Discussion started by: GoEagles
3 Replies
2. UNIX for Dummies Questions & Answers
How can I tell what user last updated a file? (1 Reply)
Discussion started by: kirkm76
1 Replies
3. Solaris
hi all,
in my server there are some specific application files which are spread through out the server... these are spread in folders..sub-folders..chid folders...
please help me, how can i find the total size of these specific files in the server... (3 Replies)
Discussion started by: abhinov
3 Replies
4. Shell Programming and Scripting
Hi
I have many file initial size zero(empty) after some munipulation , one or more file will be greater than zero. I need to send those file names if they return to zero again.
Ex.
Initially the files are zero size
Size filename
0 AAA
0 BBB
0 CCC
0 DDD... (1 Reply)
Discussion started by: Bluetoot
1 Replies
5. Shell Programming and Scripting
#!/bin/sh
##########################################################################################################
#This script is being used for AOK application for cleaning up the .out files and zip it under logs directory.
# IBM
# Created
#For pdocap201/pdoca202 .out files for AOK
#1.... (0 Replies)
Discussion started by: mridul10_crj
0 Replies
6. Shell Programming and Scripting
Hi Experts,
I have a script like
$ORACLE_HOME/bin/sqlplus username/password # << ENDSQL
set pagesize 0 trim on feedback off verify off echo off newp none timing off
set serveroutput on
set heading off
spool Schemaerrtmp.txt
select ' TIMESTAMP COMPUTER NAME ... (5 Replies)
Discussion started by: welldone
5 Replies
7. UNIX for Dummies Questions & Answers
Hi
i have folder of 26 GB on server A and want to copy to server B .i used the below commands to check file size and scp copy
du -h /folder : its shows 26G on server A
from server B:
scp -r user@serverA:/folder/* ./copying got initiated and i am checking the file size on server B... (7 Replies)
Discussion started by: rakeshkumar
7 Replies
8. Shell Programming and Scripting
Dears does anybody know how to check the file size on server A and server B before and after scp using KSH. Script should be on server A.
I will be using it for the below mentioned scenario:
I have written a code to fetch files from server A, move it onto server B compress it and save it on... (2 Replies)
Discussion started by: BrownBob
2 Replies
9. Shell Programming and Scripting
Hi All,
I have to work in the late nights some times for server maintenance and in a hurry to complete I am accidentally changing ownership or permission of directories :(
which have similar names ( /var in root and var of some other directory ).:confused:
Can some one suggest me with the... (1 Reply)
Discussion started by: shiek.kaleem
1 Replies
10. UNIX for Dummies Questions & Answers
I have been searching both on Unix.com and Google and have not been able to find the answer to my question. I think it is partly because I can't come up with the right search terms.
Recently, my virtual server switched storage devices and I think the problem may be related to that change.... (2 Replies)
Discussion started by: jmgibby
2 Replies
SCP(1) BSD General Commands Manual SCP(1)
NAME
scp -- secure copy (remote file copy program)
SYNOPSIS
scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ...
[[user@]host2:]file2
DESCRIPTION
scp copies files between hosts on a network. It uses ssh(1) for data transfer, and uses the same authentication and provides the same secu-
rity as ssh(1). Unlike rcp(1), scp will ask for passwords or passphrases if they are needed for authentication.
File names may contain a user and host specification to indicate that the file is to be copied to/from that host. Local file names can be
made explicit using absolute or relative pathnames to avoid scp treating file names containing ':' as host specifiers. Copies between two
remote hosts are also permitted.
The options are as follows:
-1 Forces scp to use protocol 1.
-2 Forces scp to use protocol 2.
-3 Copies between two remote hosts are transferred through the local host. Without this option the data is copied directly between the
two remote hosts. Note that this option disables the progress meter.
-4 Forces scp to use IPv4 addresses only.
-6 Forces scp to use IPv6 addresses only.
-B Selects batch mode (prevents asking for passwords or passphrases).
-C Compression enable. Passes the -C flag to ssh(1) to enable compression.
-c cipher
Selects the cipher to use for encrypting the data transfer. This option is directly passed to ssh(1).
-F ssh_config
Specifies an alternative per-user configuration file for ssh. This option is directly passed to ssh(1).
-i identity_file
Selects the file from which the identity (private key) for public key authentication is read. This option is directly passed to
ssh(1).
-l limit
Limits the used bandwidth, specified in Kbit/s.
-o ssh_option
Can be used to pass options to ssh in the format used in ssh_config(5). This is useful for specifying options for which there is no
separate scp command-line flag. For full details of the options listed below, and their possible values, see ssh_config(5).
AddressFamily
BatchMode
BindAddress
ChallengeResponseAuthentication
CheckHostIP
Cipher
Ciphers
Compression
CompressionLevel
ConnectionAttempts
ConnectTimeout
ControlMaster
ControlPath
ControlPersist
GlobalKnownHostsFile
GSSAPIAuthentication
GSSAPIDelegateCredentials
HashKnownHosts
Host
HostbasedAuthentication
HostKeyAlgorithms
HostKeyAlias
HostName
IdentityFile
IdentitiesOnly
IPQoS
KbdInteractiveAuthentication
KbdInteractiveDevices
KexAlgorithms
LogLevel
MACs
NoHostAuthenticationForLocalhost
NumberOfPasswordPrompts
PasswordAuthentication
PKCS11Provider
Port
PreferredAuthentications
Protocol
ProxyCommand
PubkeyAuthentication
RekeyLimit
RhostsRSAAuthentication
RSAAuthentication
SendEnv
ServerAliveInterval
ServerAliveCountMax
StrictHostKeyChecking
TCPKeepAlive
UsePrivilegedPort
User
UserKnownHostsFile
VerifyHostKeyDNS
-P port
Specifies the port to connect to on the remote host. Note that this option is written with a capital 'P', because -p is already
reserved for preserving the times and modes of the file in rcp(1).
-p Preserves modification times, access times, and modes from the original file.
-q Quiet mode: disables the progress meter as well as warning and diagnostic messages from ssh(1).
-r Recursively copy entire directories. Note that scp follows symbolic links encountered in the tree traversal.
-S program
Name of program to use for the encrypted connection. The program must understand ssh(1) options.
-v Verbose mode. Causes scp and ssh(1) to print debugging messages about their progress. This is helpful in debugging connection,
authentication, and configuration problems.
EXIT STATUS
The scp utility exits 0 on success, and >0 if an error occurs.
SEE ALSO
rcp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), ssh_config(5), sshd(8)
HISTORY
scp is based on the rcp(1) program in BSD source code from the Regents of the University of California.
AUTHORS
Timo Rinne <tri@iki.fi>
Tatu Ylonen <ylo@cs.hut.fi>
BSD
September 5, 2011 BSD