Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have the following situation: users update csv/txt files on daily basis on Windows. I use those flat files as input for my Oracle scripts which is on Unix. I need help on script/method of transferring those flat files from Windows to Unix.

My Unix shell scripting and Window batch coding is ok.

share|improve this question
    
What kind of access do you have on the Unix machine? Shell (SSH), FTP, anything else? –  ddeimeke May 3 '12 at 11:53
    
Don't use ftp, it makes username/password travel the network in clear text. Scp is easiest to script alternative, sftp isn't too bad either. Check Bruce's answer. –  jippie May 3 '12 at 18:09

2 Answers 2

You could use the SCP program that comes with famed terminal emulator PuTTY: pscp.exe

If you create public/private key files, pscp.exe should have the ability to just do something like:

pscp *.csv *.txt username@unixhost:whatever/subdirectory/

from inside a .bat file.

share|improve this answer
    
A cmd file would give him the extended syntax on windows. psftp is another option with putty. –  Nils May 3 '12 at 20:28

You have several options available. Choose one that you are most comfortable with. One potential would be to set up an SMB/CIFS share on the Unix host.

In a script from each Windows workstation, mount the SMB/CIFS share with the net command.

net use \\computername\sharename /persistent:no

After completion of the copy or move of the file to the SMB/CIFS share, you could optionally remove the share from the Windows workstation.

net use \\computername\sharename /delete

You can get full options of the net command by running net help use. Here is a good unofficial guide to configuring Samba.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.