Solved

samba windows share

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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 video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now