LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-09-2016, 09:26 AM   #1
Dustin Cook
LQ Newbie
 
Registered: Feb 2015
Posts: 28

Rep: Reputation: Disabled
Transferring the Contents of a Folder Using smbclient


I have written a Shell script that moves into a directory with some binaries files present.

What I am looking to do is transfer all the files present inside this directory.

Code:
cd /home/user/binaries
smbclient //ip.address/directory$ password -W domain -U username << ENDOFMYSMBCOMMANDS
prompt
put *
exit
ENDOFMYSMBCOMMANDS
I tried to use put * to transfer all files - but this is not accepted.

The only other option I know of is to go one folder up, and use the command mput binaries - but this copies everything including the folder.

How can I modify my script to only transfer the contents of the directory?
 
Old 03-09-2016, 10:41 AM   #2
dolphin_oracle
Member
 
Registered: Dec 2013
Posts: 329

Rep: Reputation: Disabled
I just tried this here, and

mput *

will copy all the files in the current directory on the client to the directory on the server.
 
Old 03-09-2016, 11:10 AM   #3
Dustin Cook
LQ Newbie
 
Registered: Feb 2015
Posts: 28

Original Poster
Rep: Reputation: Disabled
Thanks dolphin,

You're right! I have thought that using "mput" was for directory copying. So it never occured to move into the directory and use "mput *" to copy the contents of the directory.

All sorted now, thanks for the tip off!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Extracting the contents of a folder in a CPIO archive to another folder Refractor Linux - Software 4 07-10-2012 06:12 PM
Scripts to list folder contents and copy images from folder and subfolders brunces Linux - Newbie 6 11-03-2011 02:23 PM
Transferring outlook express contents to new linux pc floyd2466 Linux - Newbie 1 05-14-2008 01:51 AM
Can't list Samba directory contents from FreeBSD using smbclient baldwonder *BSD 0 08-26-2007 02:25 AM
how to delet the contents of a directory using smbclient.. BrianK Linux - General 2 09-05-2002 03:46 PM


All times are GMT -5. The time now is 08:43 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration