LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 08:26 AM   #1
Dustin Cook
Member
 
Registered: Feb 2015
Posts: 31

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, 09:41 AM   #2
dolphin_oracle
MX Linux
 
Registered: Dec 2013
Posts: 402

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, 10:10 AM   #3
Dustin Cook
Member
 
Registered: Feb 2015
Posts: 31

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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:46 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
Open Source Consulting | Domain Registration