[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

samba windows share

Posted on 2002-03-27
2
Medium Priority
?
661 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

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…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

656 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