Link to home
Start Free TrialLog in
Avatar of Rosa2003
Rosa2003

asked on

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?

ASKER CERTIFIED SOLUTION
Avatar of blkline
blkline

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GabeGranger
GabeGranger

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