LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-15-2006, 08:54 AM   #1
loopoo
Member
 
Registered: Aug 2005
Posts: 40

Rep: Reputation: 15
smbclient - trasnfer full content of a share


Hello all!

I am using smbclient to access a windows share. I am trying to automate a script that will copy all the files in a folder.

When connecting manually, I have to accept with "y" for each file for "mget *". Is there a way to avoid this in a script?? So it will copy all the files in the share in my local directory??


Thanks in advance,
Chris
 
Old 03-15-2006, 10:57 AM   #2
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
Not answering your question directly, but the command smbtar is more usefull to do that ...
 
Old 03-15-2006, 11:13 AM   #3
loopoo
Member
 
Registered: Aug 2005
Posts: 40

Original Poster
Rep: Reputation: 15
Thanks for your suggestion.

I will still be contraint to use smbclient.

The solution somenone else recommeded me: "yes | smbclient ..."


Chris
 
Old 03-15-2006, 02:39 PM   #4
morgolis
LQ Newbie
 
Registered: Mar 2005
Posts: 11

Rep: Reputation: 0
A shot in the dark here... try: mget -y <remainder syntax>
 
Old 03-16-2006, 03:37 AM   #5
loopoo
Member
 
Registered: Aug 2005
Posts: 40

Original Poster
Rep: Reputation: 15
Hi morgolis!

I have tried your solution too, but it seems it doesn't work, at least on my system. I am on AIX 4.3.

Thanks,
Chris.
 
Old 03-16-2006, 05:35 AM   #6
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
You can also mount the share ("mount -t cifs ..." or "mount -t smbfs ...") if you're root and then use it like a normal filesystem.
 
Old 03-16-2006, 06:53 AM   #7
loopoo
Member
 
Registered: Aug 2005
Posts: 40

Original Poster
Rep: Reputation: 15
Thanks for your suggestion, but I am not root on this system.
As I said, I must use smbclient.

Chris.
 
Old 03-16-2006, 07:50 AM   #8
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
Use the prompt command. It is a toggle command which enable/disable the confirmation question.

Code:
miguel@gold:/tmp> smbclient //myserver/myshare -U user%password
Domain=[MYGROUP] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
smb: \> prompt
smb: \> mget *
getting file xxxxxxxxxxx of size 276480 as xxxxxxxxxxxxxx (5192.3 kb/s) (average 5192.3 kb/s)
getting file zzzzzzzzzzzzz of size 299520 as zzzzzzzzzzzzz (4119.7 kb/s) (average 4573.2 kb/s)
smb: \>
 
Old 03-16-2006, 08:04 AM   #9
loopoo
Member
 
Registered: Aug 2005
Posts: 40

Original Poster
Rep: Reputation: 15
Thanks a lot. This works great and is the best solution for me.


Chris
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
smbclient - connect to a Win share loopoo Linux - Networking 5 12-12-2005 08:29 AM
smbclient - connect to a Win share loopoo Linux - Newbie 2 12-12-2005 05:54 AM
smbclient connects to a M$ share, smbmount fails douchev Linux - Networking 2 09-03-2004 02:26 AM
smbclient to win2k3 share ew0kian Linux - Software 1 07-29-2003 07:21 PM
Anyway to make smbclient show full name of share? chemzar Linux - Networking 0 05-13-2003 12:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration