How does solaris recursive scp work?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How does solaris recursive scp work?
# 1  
Old 05-18-2010
Question How does solaris recursive scp work?

How does recursive scp work? By recursive I think it should follow all the directories and copy all the matching files. It doesn't work like what I would expect. Here is a simple example that shows scp -r does not go into the subdirectories "one" and "two":
Code:
[user@webm ~/testrec]$ ls
one two zero.txt

[user@webm ~/testrec]$ ls one
oneone.txt onetwo.txt

[user@webm ~/testrec]$ ls two
twoone.txt twotwo.txt

[user@webm ~/testrec]$ scp -r *.txt root@web9:/testrec
zero.txt

[user@webm ~/testrec]$ cd ..

[user@webm ~]$ scp -r testrec/*.txt root@web9:/testrec
zero.txt


Last edited by Scott; 05-19-2010 at 03:49 AM.. Reason: Code tags, please...
# 2  
Old 05-18-2010
Why not just scp a list like
Code:
scp -p $(...) user@host:/path/.

# 3  
Old 05-19-2010
Quote:
Originally Posted by curleb
Why not just scp a list like
Code:
scp -p $(...) user@host:/path/.

This seems not working yet. From man page the '-p' option is to preserve modification times, access times, and modes from the original file. It does not do recursive copy.
# 4  
Old 05-19-2010
it's not supposed to supply recursion, just force of habit for me...

The recursion comes from the find or whatever list-setting command string you'd embed between your $(...). That would supply scp with the entire contents with which you'd want to move between sites.

Otherwise, rsync or similar options would provide for mirroring, etc...albeit not via SSH protocols.
# 5  
Old 05-19-2010
MySQL

Hi,

scp is not doing any recursive searching here.

It's the same as doing a
Code:
ls -R *.txt

. Try that and you will get the same result.

The command is only matching *.txt in the current directory. If your zero.txt file was a directory it would copy it and all of it's contents.

Does that help?

Last edited by DougyC; 05-19-2010 at 08:49 AM.. Reason: typo
# 6  
Old 05-19-2010
You need to specify a directory, not a list of files.

Code:
scp -r testrec/ root@web9:/testrec

# 7  
Old 05-19-2010
True...it's an option (under OpenSSH on Solaris), but it's much more reliable to pass a list you actually compile. The OP does not specify their SSH package, but I'm always one for telling the apps what I mean, explicitly, and not relying upon their own recursion routines.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

scp multiple files without pattern on Solaris

I need to transfer multiple files using scp between two solaris machines. I could not use pattern since they match with other files in the same directory. I tried the below command, it does not copy any files. $ scp -p user@machine1:/home/fid1/staging/\{a.ksh,b.ksh,c.ksh,d.ksh\} . But... (7 Replies)
Discussion started by: marecar
7 Replies

2. Solaris

Redirection does not work in Solaris

Hi all, i have been trying to direct o/p of one command to file, but i don get any entries in file but ouptput get displayed on command prompt. I have tried many options but still , it does not work. please guide. here is the command -bash-3.00$ /usr/local/bin/sudo lpstat -p | grep... (2 Replies)
Discussion started by: manalisharmabe
2 Replies

3. Solaris

SCP/SFTP- Stalled- solaris

hello all, I am getting the following error with the SCP/Sftp is getting stalled on solaris 10 . pxxx_xxx_SOLARIS64_1of7.zip 0% 2068KB 0.0KB/s - stalled -Write failed: Broken pipe pxxx_xxx_SOLARIS64_1of7.zip ... (2 Replies)
Discussion started by: Sojourner
2 Replies

4. UNIX for Dummies Questions & Answers

scp command solaris to windows

Can I use scp command to throw a file from my Solaris box to Windows under this path "C:\work\SSL" ? If so, Please help me with a syntax. Also help me with any alternatives I can try. Solaris ----> Windows . (2 Replies)
Discussion started by: shifahim
2 Replies

5. Shell Programming and Scripting

SCP command through ITIM does not work

Hi, We have two Linux box (Machine A and Machine B). Standalone application(ITIM) running on Machine A. Target file to copy is available on Machine B. SSH Handshaking done between Machine A and Machine B using normal user "ssh". Standalone application running on Machine A under user... (2 Replies)
Discussion started by: satish_gauns
2 Replies

6. Shell Programming and Scripting

scp : recursive copy doesn't work

Hi I have a problem with scp command : I try to copy a list of files from source to destination, it works fine but if there is a directory not existing on destination, it doesn't automatic create. Syntax : scp -rp /<PATH>/<NEW_DIR>/<FILE> <USER_DEST>@<HOST_DEST>:<PATH>/<NEW_DIR>/<FILE>... (5 Replies)
Discussion started by: madmat
5 Replies

7. Filesystems, Disks and Memory

HD Controller does not Work in Solaris

Hi, I'm attempting to build a raid Z NAS using solaris, but I only have 4 sata ports on my MB, so I bought a Rosewill RC-211 PCIe controller (adds 2 sata II ports). I'm new to solaris, but I understand that to add a new drive, you first run #devfsadm, which puts the files into /dev/dsk. I... (3 Replies)
Discussion started by: ciscocbee
3 Replies

8. Solaris

Need An Idea On How Solaris Work

PLS AM A NEWBE IN SOLARIS AND I NEED A GOOD MATERIAL ON HOW SOLARIS WORK.ie, THE INTERNAL WORKINGS OF SOLARIS. (2 Replies)
Discussion started by: dba
2 Replies

9. Shell Programming and Scripting

SCP file transfer command on solaris

I need to transfer multiple files using SCP between two solaris machines. Can somebody explain how to achieve that ? (3 Replies)
Discussion started by: parthum
3 Replies

10. Solaris

SCP from one solaris box to another without copying links

I am doing a scp (directory)from one solaris box to another.The problem is that all links present in that directory also get copied .I do not want the links to get copied .currently I am using following syntax scp -rvp pcserver info@appudemo.sea.us.wam.net:/home/info I checked the man... (1 Reply)
Discussion started by: u449064
1 Replies
Login or Register to Ask a Question