What is scp-ed over?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting What is scp-ed over?
# 1  
Old 02-21-2007
What is scp-ed over?

Hi all,

i have a directory in server A. the directory path is /home/kevin. I need to scp the directory to another server B. i would like to ask, when i do a scp of the /home/kevin , i can expect all the files from A to go B. However, how about the hidden files? for example the ssh keys in the .ssh directory which are hidden, do the hidden files get scp-ed over as well?

I have not tried it because i do not want to unwittingly over write the identity keys in B.

In addition,
i was thinking of using the tar function. first i tar all in A then i extract the tar file in B. However, i realise in the tar file, the directory structure is home/kevin. what happened to the '/' infront of home? and if i extract the tar in B, would the files go to /home/kevin or home/kevin? there is a difference right, i suppose?
# 2  
Old 02-21-2007
Hi new2ss,
For your first question:
scp-ing a directory (with the -r) option will also scp all files under that directory that have read permission for the id being used to scp the files. Whether a file is hidden or not will not make any difference.

About the second one:
The difference between /home/kevin and home/kevin in a tar file is simply that the first is an absolute path while the second is a relative path. In the second, if you extract from the tar file while in, say, /tmp, the new path will be created as /tmp/home/kevin. With the /home/kevin in the tar file, the same absolute path will be used.
# 3  
Old 02-23-2007
blowtorch,

thanks for your explanation.
# 4  
Old 03-04-2007
I have a the following directory in machine A " /home/new2ss"

i have created a tar of the files in the directory.
the contents in the tar is as follows
home/new2ss/file1
home/new2ss/file2
...
...

now that i want to extract the tar in machine B's /home/new2ss directory. How should i do it? since my tar achieve's files are all in relative filepath, in which directory should i extract it in machine B? Can i extract it in the "/" directory? Would it be a wise thing to do?

Or should i recreate the tar archieve with the filenames in absolute directory? If i do that, it does not matter where i extract it in B since the directory is absolute ?
# 5  
Old 03-05-2007
Yes, to extract in /home/new2ss/..., you have to extract the tar in the / filesystem. Make sure that there are no files except home/new2ss/... in the archive, and it should be pretty safe.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to use scp?

How to copy multiple directories using single command on solaris 10 from server A to server B. I tried scp but its working only one directory at atime How to acheive this with simple and short solution????? (6 Replies)
Discussion started by: buzzme
6 Replies

2. UNIX and Linux Applications

Need help with scp

Hi, I am trying to do scp from server A to server B. But while doing the scp i am getting the following message. +-----------------------------------------------------------------+ | This system is for the use of authorized users only. | | Individuals using this computer system... (6 Replies)
Discussion started by: sidh_arth85
6 Replies

3. Shell Programming and Scripting

SCP

Hi All, Please help on the below command scp -r 'directory name'inrvgo@IP:/export/home/muthu/prod_12-09-2010 I am trying to copy a directory from one server to another server using the above command but its displaing the error (missing destination file) but the diectory was there in the... (1 Reply)
Discussion started by: thelakbe
1 Replies

4. AIX

scp

1. how to move files in a directory using scp ? 2. how to move the entire directory ? 3. Will the file and the directory permissions affect scp usage? (1 Reply)
Discussion started by: samsungsamsung
1 Replies

5. Red Hat

scp with su

Hi Friends, I am trying to copy some files over the network in between my linux servers. I am using scp command for this. by default direct ssh root login is disabled on all of my linux servers. Normaly we used to login as a normal user and the su to th root user. unfortunately root user is... (1 Reply)
Discussion started by: arumon
1 Replies

6. Shell Programming and Scripting

Is this possible with SCP?

I normally download a directory recursively using: scp -r <name>@host:<path> . This has worked fine. As everyone knows this will download all of the directory named in <path> and all of the sub directories. I would like to know if it is possible to not download a particular file if it... (5 Replies)
Discussion started by: cpabrego
5 Replies

7. UNIX for Advanced & Expert Users

help with scp

hi all in my script i was using the "scp" command to copy 2 files from a certain directory on server A to the same directory on another server B, but for some reason its only copying the first file in the directory. This is the frst time that i used the scp command,any ideas appreciated. thnks (5 Replies)
Discussion started by: bkan77
5 Replies

8. UNIX for Advanced & Expert Users

Scp

I am trying to transfer a 10g files using scp, but I am getting timeout errors is there anywhere that I can modify a config file or something to increase the time. (4 Replies)
Discussion started by: rbizzell
4 Replies
Login or Register to Ask a Question