Solved

samba windows share

Posted on 2002-03-27
2
648 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ACK Attack 5 65
Linux DNS problems 23 575
How to Edit Files in Linux 6 132
Master-Master-Slave BIND setup 2 75
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 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