Solved

samba windows share

Posted on 2002-03-27
2
625 Views
Last Modified: 2008-03-10
Hi

I was wondering how do you copy a directory from a windows share to my linux box.

I can connect
smbclient //hostname/share

I get the smb prompt.

I can get a file using get or mget but how do I copy a whole dir with its sub dir to my computer?

Thanks
0
Comment
Question by:onestar
  • 2
2 Comments
 
LVL 7

Expert Comment

by:lewisg
ID: 6901882

Type recurse at the smb prompt to toggle recursion on or off. Type man smbclient for more info.
0
 
LVL 7

Accepted Solution

by:
lewisg earned 50 total points
ID: 6901936
This might be a little more complete.

The windows machine is named "server" and the share is "c". There is a directory named "aatest" with two subdirectories "dir1" and "dir2". Several files named "fileX.txt" are scattered about. Like so:

C:\aatest>dir /s /b
C:\aatest\file1.txt
C:\aatest\dir1
C:\aatest\file2.txt
C:\aatest\dir2
C:\aatest\dir1\file3.txt
C:\aatest\dir2\file4.txt
C:\aatest\dir2\file5.txt


Here is a copy of a ssh session.

[root@vip test]# smbclient //server/c
Password:
smb: \> cd aatest
smb: \aatest\> prompt
smb: \aatest\> recurse
smb: \aatest\> mget *.*
smb: \aatest\> q
[root@vip test]# ls -R
.:
dir1/  dir2/  file1.txt  file2.txt
./dir1:
file3.txt
./dir2:
file4.txt  file5.txt


After connecting with smbclient cd to the source directory, toggle off the yes/no prompts, toggle on recursion. The mget *.* gets all files. q quits smbclient and ls -R displays the copied files.

I hope this answered your question.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question