Solved

How to copy directories from Linux to Windows?

Posted on 2004-09-29
2
603 Views
Last Modified: 2013-12-16
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
Comment
Question by:Rosa2003
2 Comments
 
LVL 6

Accepted Solution

by:
blkline earned 500 total points
ID: 12185911
use "mput"...

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

Barry
0
 

Expert Comment

by:GabeGranger
ID: 12191850
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This is the error message I got (CODE) Error caused by incompatible libmp3lame 3.98-2 with ffmpeg I've googled this error message and found out sometimes it attaches this note "can be treated with downgrade libmp3lame to version 3.97 or 3.98" …
Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now