Browsing articles tagged with "scp - Admins Goodies"
May 23, 2013
tom

SCP transfer only modified files

I’m using below command to transfer files cross server scp -rc blowfish /source/directory/* username@domain.net:/destination/directory Is there a way to transfer only files modified files just like update command for cp? Asked by Jae Choi rsync is your friend. rsync -ru /source/directory/* username@domain.net:/destination/directory If you want it to delete files at the destination that no longer exist at the source, add the –delete option. Answered by Flup Check more discussion of this question. Bookmark on Delicious [...]

Continue Reading »
Sep 3, 2012
tom

How to make SCP on Linux output “success” to stdout instead of stderr?

We have a cron job that sends stuff to another company using SCP. The command look like this: 10 0 * * * ssh USER@LOCAL-SERVER ‘scp -q ~/some/dir/* REMOTE_SERVER:/other/dir/’ >> ~/log/some.log This was setup by someone else. Now my problem is that my boss is on the cron mailing list, and despite the “>> ~/log/some.log” cron still sends an email every day, because even if the transfer was successful, it still outputs: Connection to REMOTE_SERVER [...]

Continue Reading »
Aug 30, 2012
tom

Cloning entire partition of a server over a network

Using the linux command ‘dd’ you can clone a partition to a .img file. I have used this method for duplicating flash drives for use with many servers in the past. Then if one goes down, it is very easy to restore it if needed. Does anyone know if a similar thing is possible to do over a network? I have a Redhat server that I would like copy everything from, in order to create [...]

Continue Reading »
Aug 3, 2012
tom

Recommend practice for checking if files where copied using SCP

I’m trying to create simple backup script that copies some files to timestamped directory on the remote machine – this part is working quite OK, because I didn’t run into issues like e.g network connectivity yet. I would like to know what is recommended practice for checking if my files were copied correctly. I was thinking about 2 ways to do this: Check file sizes/md5 before copying them and compare them with ones on remote [...]

Continue Reading »
Jul 15, 2012
tom

Reliable file transfer over slow or flaky network link

I need to transfer a number of files files over a low-quality broadband link to a server. The files are large, and take approximately 30 minutes to transfer per file. I use scp, but it sometimes hangs — the transfer doesn’t fail with an error, it keeps running, but no further data is transferred. So, I’m looking for a “failsafe” upload solution, one that will work even if the link fails for a few minutes [...]

Continue Reading »
Jul 15, 2012
tom

bind interface for upload : scp works, not rsync

I need to upload file on a specific interface. This cannot be set-up via iptables, because my script output on several interfaces. this is working fine : scp -oBindAddress=192.168.100.1 … but rsync –address=192.168.100.1 is still sending on eth0 (192.168.10.1) how could I force rsync to use 192.168.100.1 ? any idea ? Asked by user1219721 rsync can be told what SSH options to use with the “-e” switch. Try something like: rsync -e ‘ssh -oBindAddress=192.168.100.1′ Answered [...]

Continue Reading »
May 16, 2012
tom

scp to AWS EC2 – error – “Please login as the user ”ubuntu“ rather than the user ”root“.”

I’m trying to scp a file to /var/www because I’m playing with apache. To move the file I do scp -i <ec2-shh-key> localfile root@<ec2-instance-ip>:/var/www/fileremote. But this gives me an error: Please login as the user “ubuntu” rather than the user “root”. How can I solve this problem? EDIT: I have discovered this superuser question which answers the question by first scp’ing the file to a non-sudo dir, then passing a sudo mv command over ssh [...]

Continue Reading »
Apr 30, 2012
tom

Limit scp (with sshd on centos) speed / rate

I’d like to let users download / upload files via scp to my centos 6.0 system, it’s connected to lan via Gigabit ethernet, but I don’t want transfers to flow at that speed. I want to limit the speed to 10Mb/s. I have managed to find the right configuration for vsftpd to limit the rate, but failing to find the same for sshd. Any help would be very much appreciated. Edit : Just to make [...]

Continue Reading »
Apr 24, 2012
tom

does scp affect performance

I am using scp to copy a file from remote server to local and it is working as expected. scp remote_server.com:/data/ar_uw2a_vol_0286036c_2012-04-24-05-35-00 . I have 2 questions: 1) Since I am copying file from production server, I do not want to affect the performance if scp takes time. Does this operation affect the performance of remote server? 2) Is there any better / faster way to copy a file? The file is already going to be [...]

Continue Reading »
Apr 18, 2012
tom

VMware seems to throttle SCP copies, what can be the reason?

I seem to have a strange issue with my VMware cluster, where I get inconsistent SCP transfer rates. I have Cluster1 and Cluster2, physically in different regions. I need to transfer large vmdk from Cluster1 to Cluster2. Here is what I get: SCP from VMware host, directly to VMware host, no compression: 4MB/s SCP from VMware host, directly to VMware host, with compression: 0.5MB/s SCP from VMware host in Cluster1, to one of the virtual [...]

Continue Reading »