[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 615
  • Last Modified:

How to copy directories from Linux to Windows?

Hello,

I want to copy some files from my Linux box (RedHat9.0) to my Windows box (Windows 2003). For that I use Samba.
The files are:
/home/jdoe/mail/*.*
/var/spool/mail/jdoe

I can connect with smbclient from my Linux box to my Windows box

smbclient //MyWindowsServerName/MySharedCarpet -U administrator -W WORKGROUP
Password:****
smb: \>

Initially, I'm on /root/ carpet, but I don't know how to copy /home/jdoe/mail/*.*
If I do:
smb: \> put /home/jdoe/mail/*.*
I get error: /home/jdoe/mail/*.* does not exist
How can I copy directories and files from another path?

0
Rosa2003
Asked:
Rosa2003
1 Solution
 
blklineCommented:
use "mput"...

smb: \> lcd /home/jdoe/mail
smb: \> mput *.*

Barry
0
 
GabeGrangerCommented:
The way I get files from my linux boxes to windows boxes is as follows.

Make sure their is the same username and password setup on both machines which permissions setup on the w2k box for that user

then modify the follow to meet your needs

smbmount //<server/foldermapping> ~/<foldermapping> -o username=<username>,password=<password>,uid=<username>,gid=<username>
s,fmask=600,dmask=700

the ~/<foldermapping> simply mounts in my home area, you could of course use the full path

/users/foo/<foldermapping>

then

cp /home/jdoe/mail/*.* ~/<foldermapping>/
cp /var/spool/mail/jdoe ~/<foldermapping>/

once its copied everything across I simpy run

smbumount /users/foo/<foldermapping>

this removes the mount point

I normally script this and then run it through cron so that each day and a set time it does it..

P.S. remember to remove the "<" ">"

I hope this is clear enough?

Gabe
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now