LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 09-13-2005, 12:38 AM   #1
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
useing SCP to copy entire directories with sub folders?


i have read the man scp and have not been able to understand enough of it to figure out how to scp a directory to the point it will move the directory, all files and subdirectories with subfiles, etc...

so if i have /home/user/folder/subfolder and i want to scp everything from comp A to comp B and keep /home/user/folder/subfolder exactly as they are how would i do that?
 
Old 09-13-2005, 12:45 AM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
"-r" flag to copy directories (same as with "cp"; by default it only copies files not directories, "-r" makes it copy directories)

Last edited by spooon; 09-13-2005 at 12:47 AM.
 
Old 09-13-2005, 01:44 AM   #3
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Original Poster
Rep: Reputation: 45
that is what i thought, but last time i tried that i got an error both with -r and with -R
 
Old 09-13-2005, 09:42 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
Can you show us an example?
 
Old 09-13-2005, 10:07 PM   #5
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Original Poster
Rep: Reputation: 45
Code:
ray@ssmadebian:~$ scp -R /home/ray/kayla/ xindal@192.168.10.150:
scp: illegal option -- R
usage: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 [...] [[user@]host2:]file2
i must of been doing something wrong with that -r before maybe had an extra space or something in there as it worked tonight. oh well...

Thanks again for the help.
 
Old 09-13-2005, 10:08 PM   #6
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 48
it's "-r" (lowercase "r")
 
  


Reply


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] scp directories ? the_rhino Linux - Newbie 12 10-03-2012 03:51 PM
Copy an entire install to second harddisk seriesx4 Linux - General 7 10-13-2005 12:44 PM
how to copy entire website using linux ngan_yine Linux - Newbie 3 03-09-2005 05:04 PM
is it possible to copy an entire fc2 system to another disk? parv Fedora 8 09-20-2004 07:04 PM
xmms en que entire directories oily_rags Linux - Software 2 09-14-2004 02:50 PM


All times are GMT -5. The time now is 01:15 AM.

Main Menu
Advertisement
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