?
Solved

samba windows share

Posted on 2002-03-27
2
Medium Priority
?
663 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 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

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…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
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…

807 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