Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy file from windows to linux? 3

Status
Not open for further replies.

meldrape

Programmer
May 12, 2001
516
US
Hi there, I am not familiar with Linux yet [sad]. I have a Microsoft Access application exports a text file. Is there a way to write a batch file to copy it from the windows server to a Linux server? We are a lumber company migrating to a new inventory system that's on the Linux platform and we would be importing this file into our new system. Many thanks in advance.
 
Thanks for the speedy reply. I should have said "programmatically". I have FTP and can do it, no prob manually. My big question is, I need a programmatic way to do it. Any other thoughts?
 
from windows or linux? from windows you have the "windows scheduler" in order to trigger a script using either ftp or scp and in linux you have the cron jobs.



Cheers.
 
Thanks again for the info. Now what? Is there a way to run something from windows that will run something on linux? If this is too hard, tell me and I'll leave you alone because I have ZERO idea about any of this, can't seem to find anything "out there" on the internet and need a teeny bit more detail. Thanks.
 
ok, these are the fact:

1. you need to transfer a .txt file to a linux. from windows? or linux? let's say from windows.
2. I guess this is only one file
3. create an script like:

cd letter:\path\to\source\folder
ftp your.linux.com
user
password
cd /path/to/target/folder
put file.txt
exit

4. config your "windows scheduler" in order to execute the script at some hour.

Is there a way to run something from windows that will run something on linux?

you DON'T need to run anything in the linux box from windows, just make sure that ftp server is running in the linux box.

there is another way from the linux box:
1. share the windows folder where the source file is conained
2. using smbfs (samba) mount that shared folder from the linux box
3. via cron job, just copy the file to a local folder in the linux box.

Cheers.
 
You are awesome. That helps immensely. Many thanks.
 
There are lots of ways to do this. The first thing is to decide on a way to transport the file. Which protocol.

SMB / CIFS
NFS
FTP
SCP
RSYNC

Best choice is SMB / CIFS.

Mount the drive.
Copy the file
Unmount the drive.

This can be done from the linux server side or the windows client side.

If you use the windows client side then you have to configure samba. But you don't need anything elaborate so that will be very easy. you can use either Task Scheduler or the command "at" to do this.

On the Linux Server side, you can make a shell script that runs in cron to mount the drive, copy the file, unmount the drive.

If you need any help with specifics just let us know. :)
 
If you need to do anything with windows, do yourself a favour and install and configure Samba.

HTH,
C
 
thanks, Chris. That's what we did and it's working great now.
 
BTW: It might be worth mentioning a few other solutions for one-off transfers, particularly for people with only one, dual-boot system.

You could setup linux to read and write to the windows file systems or you could burn a CD (or DVD) or use a memory stick.

These ideas are obviously not relevant to you guys but they might help some poor soul out there. :)


Trojan.
 
I just bought a SanDisk Cruzer Mini 1.0GB flashdrive and my Windows->Linux->Windows filecopying woes are cured (single system/dual-boot scenario). I mention this because I had never done USB in Linux in my years, and was hesitant to buy one of these drives. But now I'm hooked! Plugged it in my Fedora Core 3.92 box, it was recognized and mounted no sweat. Windows XP SP2 Home took a few seconds to install a driver, and then it was good there too.

----
JBR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top