Solved

How to copy directories from Linux to Windows?

Posted on 2004-09-29
2
605 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
AWS RDS 3 66
AWS vpc peering connection 1 42
expectj telnet failing 5 23
looking for a CENTOS ISO to download with x window installed 2 19
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

910 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

22 Experts available now in Live!

Get 1:1 Help Now