LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Smbclient copy from Linux to windows (https://www.linuxquestions.org/questions/linux-software-2/smbclient-copy-from-linux-to-windows-370175/)

depam 10-05-2005 09:36 PM

Smbclient copy from Linux to windows
 
Guys, is there a way to copy file from Linux to a shared folder in Windows?

I tried using the smbclient and have successfuly logged-in without a password. However, I like to include the it in crontab in such a way that it will copy the /home/users directory to windows shared folder without being prompted by a password. Hope you can help me on this. Thanks

pingu 10-06-2005 04:33 AM

How about mounting that Windows-share in your Linux?
Put this in /etc/fstab:
Code:

//servername/sharename      /mountpoint        cifs    noauto,user,username=pingu,passwd=xxxx,gid=501,uid=501,iocharset=iso8859-15
If you want it done automatically at bootup, change "noauto" to "auto"
Now those "uid=,gid=,iocharset=" are appropriate for me. It makes my Linux-user own the directory and uses my Swedish characterset.
Another possibility is making a script, I had this in/usr/local/sbin/localmount:
Code:

mount -t cifs -o credentials=/usr/local/etc/me -o uid=501 -o gid=501 //servername/sharename      /mountpoint/
And a file only readable by root(!) /usr/local/etc/me with two lines:
Code:

username=pingu
password=xxxx

Then run 'localmount' when I want it mounted (with $PATH set, of course) or add a link in /etc/rc#.d/ to execute the localmount script at bootup.

All you need do then is a normal copy-operation, could easily put that in crontab.

ravis007 12-17-2009 06:37 AM

Yes
I also have the same goal.
I want to copy data from linux machine to windows.
I m using smbclient.
But how to proceed further.
I want to do this without a password.
Please reply

depam 12-18-2009 07:59 AM

Try mapping the drive to Windows. There is an option in Windows where you can map it using a specific username and password. You will need to key in the password once and it will stay alive unless you restart your machine.

cojo 01-02-2010 04:01 PM

this is how I mapped to my windows share:

smbmount //WinSrv_Name/sharename /mnt/folder -o username=userid,workgroup=your_domain,password=xxxxx,rw,gid=550,dmask=770


All times are GMT -5. The time now is 06:18 PM.