Difference in file sizes being copied by scp. HELP!

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Difference in file sizes being copied by scp. HELP!
# 15  
Old 06-08-2012
Quote:
Originally Posted by NotALinuxGirl
Yes. I figured I am missing 1.5GB of data, and it would take about an hour to copy. So I put sleep 80min. I'll see result on Monday
I repeat: This is a bad scheme to use here. Either have one end control both operations so that they never run simultaneously, or never put partial files where they might get mangled -- only put in complete ones.
# 16  
Old 06-08-2012
Quote:
Originally Posted by Corona688
As an aside: Why is this running as root? All it's doing is operating on files, there's no reason to use root for that. That's dangerous.
I "inherited" the crontab from an admin who is no longer here. Since I am not a sysadmin, I try to avoid making too many changes on the system. As far as I know, to run scp from crontab I (as a user) have to be setup on the other machine. I could probably run as oracle or some user. I will test it.
# 17  
Old 06-08-2012
Quote:
Originally Posted by NotALinuxGirl
I "inherited" the crontab from an admin who is no longer here. Since I am not a sysadmin, I try to avoid making too many changes on the system.
Fair enough, but you may have inherited something rather junky. If you have to put in sleeps "in case it's not done yet", something's very wrong with it.
# 18  
Old 06-08-2012
Sorry, I'm not sure I understand what you mean by
"I take it there are two processes here -- a local one which copies the files over, and another on the server, which runs unseen, and extracts the .gz files into logs"

My crontab runs:
20 3 * * 1,2,3,4,5,6 /data05/oradata/dpdump/cpFromDB.sh > /data05/oradata/dpdump/cpFromDB.log 2>&1

And here is my script:

cpFromDB.sh

scp -C root@xxx.xx.xxx.3:/data05/oradata/dpdump/*.gz /data05/oradata/dpdump/.
ssh -l root xxx.xx.xxx.3 rm -f /data05/oradata/dpdump/*.gz /data05/oradata/dpdump/db*.log

So, scp is the one that "a local one which copies the files over", but where is the other one that "on the server, which runs unseen, and extracts the .gz files into logs"? Is it ssh line?
# 19  
Old 06-08-2012
No problem with running such a copy as root. We need the root ulimit for this size of file transfer.

Hmm. 10 hours to copy 15 Gb suggests something like a 4 Mbits/sec leased line rather than say a Gigabit local LAN connection. Maintaining a 100% reliable WAN connection across a leased line for 10 hours is a dream. The rsync command across a slow link is a lot better at dealing with network glitches than scp .

Have you considered a local (relatively quick) backup followed by a slow secondary backup of that backup to the remote site utilising rsync?
# 20  
Old 06-08-2012
Quote:
Originally Posted by NotALinuxGirl
Sorry, I'm not sure I understand what you mean by
"I take it there are two processes here -- a local one which copies the files over, and another on the server, which runs unseen, and extracts the .gz files into logs"
I was confused for a while, pardon me. I got the source and destination mixed up.
# 21  
Old 06-12-2012
Guys, thank you for your help. Unfortunately, using "sleep " didn't help. I still get corrupted, incomplete file.

I ran ulimit -a. Looks like I do not have any size limitation.


ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 71680
max locked memory (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 71680
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited


I'm going to read up on rsync now.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Cp via NFS vs. scp yields unexpected difference

I have two Linux machines, Linux1 and Linux2. They both have two NFS mounts. We'll call them /scratch1 and /scratch2. And they both reside on the same NetApp filer. If I copy a 512Mb file from /scratch1 to /scratch2 while logged on Linux1 it takes 40s. However if I scp this file from... (1 Reply)
Discussion started by: crimso
1 Replies

2. Shell Programming and Scripting

Wait for file to get copied in server path and then proceed

Hi, I have a requirement to create below script: Script must run infinitely in background. It will check a particular type of file to be copied in specific folder of server Script must wait till any file gets fully copied ..(important) and then It will read that file Experts please... (4 Replies)
Discussion started by: Vikash163
4 Replies

3. Linux

Difference in binary file sizes after deploying package via yum/rpm

Hi Guys, I have an issue whereby I package up an rpm and when I deploy it, the binary filesizes differ from what I packaged up from the SOURCE directory. from source - -rwxrwxr-x 1 user group 685156 Sep 26 15:50 cybAgent.bin after install - -rwxr-xr-x 1 user group 683388 Oct 16 11:10... (4 Replies)
Discussion started by: gazza-o
4 Replies

4. Shell Programming and Scripting

no of files copied by scp command

hi, I have a script which copy files by using scp command. when i run that script, i can see the process meter but I want to know how many files have been copied. suppose, by using scp 10 files is being copied and I can see process meter for all 10 files. but i also want to see ... that 10... (0 Replies)
Discussion started by: anshu ranjan
0 Replies

5. Shell Programming and Scripting

Extract a number from a line in a file and sed in another copied file

Dear all, I am trying to extract a number from a line in one file (task 1), duplicate another file (task 2) and replace all instances of the strings 300, in duplicated with the extracted number (task 3). Here is what I have tried so far: for ((k=1;k<4;k++)); do temp=`sed -n "${k}p"... (2 Replies)
Discussion started by: mnaqvi
2 Replies

6. UNIX for Dummies Questions & Answers

Using sudo scp -r – can't get everything copied though

I want to copy a folder and all its contents of ~700GB from a computer to another. I've tried sudo scp -r directory/ admin@host:directory but the result is that the copied folder is about 2GBs smaller than the original. I checked the shell for errors and found some "file doesn't exist" errors.... (2 Replies)
Discussion started by: MJH
2 Replies

7. Solaris

Check copied file

Hi all, If i wanted to copy file within different folders or different servers, how do i determine the copied file is absolutely correct :confused: Is it using cmp and chksum command enough? Anyway that i can make further checking? Thanks in advance for reading & anyone who reply the... (7 Replies)
Discussion started by: beginningDBA
7 Replies

8. UNIX for Dummies Questions & Answers

Can A File Be Copied to an RS232 Port on Unix?

We have a text/csv file (4mb) sitting on a Unix box. The PC belongs to a retail store and they're asking me to bring the file over to Windows so they can import the file. Can a file be copied to an rs232 port? If so how? The idea is that I'll hook up a null modem cable to the Unix com port,... (2 Replies)
Discussion started by: alivebyscience
2 Replies

9. Shell Programming and Scripting

How to check file is being copied

I wanna check whether a file is being copied ,i.e the file size is increasing. Thanks for your help (2 Replies)
Discussion started by: anhkeen
2 Replies

10. UNIX for Dummies Questions & Answers

How to find File copied completely or else ...

In Unix, I am having one file getting copied to some directory. Which command will help me ensure, that file is not completely copied to the disk? (2 Replies)
Discussion started by: videsh77
2 Replies
Login or Register to Ask a Question