[olug] samba to windows share using UNC?

Theodore Katseres tedkat at gmail.com
Thu Jun 19 22:45:23 UTC 2008


On Thu, Jun 19, 2008 at 4:49 PM, Ryan Stille <ryan at cfwebtools.com> wrote:
> Theodore Katseres wrote:
>> On Thu, Jun 19, 2008 at 3:51 PM, Ryan Stille <ryan at cfwebtools.com> wrote:
>>
>>> Is it possible to copy a file to a windows share, without mounting it as
>>> a local file system first?  I've used smbmount in the past, then copied
>>> the file, but in this case I just want to copy it using a UNC path,
>>> specifying the username/password on the command line.
>>>
>>> -Ryan
>>>
>>
>> Without mounting try ...
>>
>> smbclient //server/share -U user%pass -c 'put file'
>>
>> where "file" is in your local machine's cwd.
>>
>>
>
> Awesome, that worked.  But my goal was to not take up space on the local
> machine.   I'm creating a 4GB file, and I'd rather place it directly on
> the remote machine, rather than create it locally and then copy it.
> Anyway to do that?

Same command with a twist :)

./program | smbclient //server/share -U user%pass -c 'put - rfile'

stdout of "program" piped to smbclient;
  put stdin to remote file "rfile"

-- 
Ted Katseres
 ||=O=||



More information about the OLUG mailing list