Connecting to SMB share in python

R

Ronnie Kwok

Hello,

I am trying to write a script that copy files from my local machine to a samba
share.

I've notice a library call Pysamba which is a wrapper on smb service but it
requires a compilation of SAMBA with some amendment in order to use it.

Are there alternative method that I could do the same thing?

Thank you for your advise.

ronnie
 
T

Tim Golden

Ronnie said:
Hello,

I am trying to write a script that copy files from my local machine to a samba
share.


Can't you just mount the share (albeit temporarily) and copy
the files over in the normal way? You haven't said what OS
you're on, but I'm assuming Linux otherwise you'd simply be
talking about a Windows share and copying to a UNC.

TJG
 
R

Ronnie Kwok

Thank you for the reply!

Yes, I am running the script under linux and it will be doing some
processing before copying it over to the samba mount.

It's totally fine to mount it with os.sys(...) approach but I am just
thinking if there's other option.

ronnie
 
D

Diez B. Roggisch

Ronnie said:
Thank you for the reply!

Yes, I am running the script under linux and it will be doing some
processing before copying it over to the samba mount.

It's totally fine to mount it with os.sys(...) approach but I am just
thinking if there's other option.

None that is any more comfortable. If anything, you'd need smbclient or some
such to list and fetch data - which is *much* more complicated that simply
mounting a share defined in fstab.

Diez
 
T

Tim Golden

Ronnie said:
Yes, I am running the script under linux and it will be doing some
processing before copying it over to the samba mount.

It's totally fine to mount it with os.sys(...) approach but I am just
thinking if there's other option.


I'm not really a Linux person but from all I can see
from Googling around a bit, the os.system ("mount/unmount")
option is still the most viable. Hopefully someone with
real expertise can chip in.

BTW, opinion in this ng/mailing list tends to favour
bottom-posting or interleaved posting.

TJG
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top