LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-20-2009, 07:06 AM   #1
Swapna173
LQ Newbie
 
Registered: Dec 2007
Posts: 25

Rep: Reputation: 15
scp command


I want to copy files between two linux machines

1) I want to copy files on the 2nd machine to the 1st machine.
2) Move the copied files in the 2nd machine from one directory to other directory. (i.e. to take backup)
3) I am trying to use scp command to copy files in Step 1.
4) and ssh command for both step 1 & step2
5) Now my question is : if ssh-agent is corrupted or killed will scp work?

The main thing over here is I want to avoid creating script files on the 2nd machine for copying and taking backup

Thanks in advance
 
Old 05-20-2009, 07:11 AM   #2
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
I'd have a serious look at rsync if you want to backup files. It's the best and will handle hidden files, etc a lot better.

You can also use it as a daemon and run a repository.

Just my 2c.
 
Old 05-20-2009, 07:20 AM   #3
inside-man
LQ Newbie
 
Registered: Mar 2009
Posts: 16

Rep: Reputation: 1
Hello, scp and rsync with ssh (as far as i know) , both use the ssh service for communication, this means it is necessary to have such daemon running. But here my question, have you ever seen an ssh service crashing? O.K. there were reasons that the target computer is not answering (hard disks full, whole computer hangs), but in this case it makes no sense to have ssh running and the rest is blocked. I have never seen a working machine where only ssh daemon was hanging, in most cases a lot of other things were not working correctly but on ssh the machine was reachable and managable.

By the way: rsync is a mighty tool it should fulfill all your requirements....

Regards Randolf Balasus
 
Old 05-20-2009, 07:28 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
Though ssh agent will really not hang by itself but for exceptional reasons, scp session can end if you are using it on terminal emulator and if the terminal is closed then the session will end without completing the task.
 
Old 05-20-2009, 08:14 AM   #5
eco
Member
 
Registered: May 2006
Location: BE
Distribution: Debian/Gentoo
Posts: 412

Rep: Reputation: 48
Quote:
Originally Posted by linuxlover.chaitanya View Post
if you are using it on terminal emulator and if the terminal is closed then the session will end without completing the task.
To solve that you can use the screen command which will allow you to discnnect from a session and connect later on.
 
Old 05-21-2009, 01:54 AM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,269

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
If this is a one-off exercise, use scp to copy across systems, and ssh to use local cp between dirs.
If its a regular thing eg weekly backups, then yes, use rsync (with ssh option) & cron.
 
  


Reply

Tags
rsync, scp, screen, ssh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
scp command zchoyt Linux - General 10 04-02-2014 07:47 AM
Translating windows pscp command to linux scp command help robward Linux - General 2 01-17-2008 06:02 AM
SCP Command yusufs Linux - Newbie 3 11-07-2007 02:44 PM
command of scp Paxmaster Linux - General 4 01-06-2005 12:59 PM
error with scp command eduac Linux - Security 2 08-07-2003 04:50 PM


All times are GMT -5. The time now is 11:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration