4

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 a script/method of transferring those flat files from Windows to Unix.

  • 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
  • WinSCP.exe is a useful tool, as well as using PuTTy.exe (like @BruceEdiger mentioned) – Kevdog777 Jun 10 '16 at 9:49
7

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.

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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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