Using Samba for batch runs in windows

Posted on 2006-05-09
Last Modified: 2010-03-18
I have not worked on Samba so far. I need some help in setting up this job. I need to run a batch job in windows 2000 server having IIS 5 and Jrun 3.11. The job is to import text files into the database.  The code is in Java.

Do I need to Install Samba on windows? What setup I need to do? Can anyone help me in setting up of this job?

java -Xms64m -Xmx128m -classpath c:\jltclasses\;c:\jrun\lib\ext\jcifs-0.6.5.jar;c:\JRUN\servers\default\ibs\WEB-INF\classes\;C:\javaibs\;c:\jrun\lib\ext\jakarta-oro-2.0.6.jar;c:\jrun\lib\ext\msbase.jar;c:\jrun\lib\ext\mssqlserver.jar;c:\jrun\lib\ext\msutil.jar;c:\JRUN\lib\ext\servlet.jar;c:\JRUN\lib\ext\regexp.jar;c:\JRUN\lib\ext\xalan.jar;c:\JRUN\lib\ext\xercesImpl.jar;c:\JRUN\lib\ext\xml-apis.jar;c:\JRUN\lib\ext\jdbc.jar com.YYY.xxxxx.dataimports.programname smb://yourWindowsUser:itsPassword@yourInboxHost/ftpinbox/aetna/ "JET*" yourdatabaseHost yourdatabaseUser yourDatabasePassword > importReports/report%YMD%.txt

This is a very urgent request. Can someone give me the Information at the earliest?
Question by:sriniram
    LVL 27

    Expert Comment

    "I need to run a batch job in windows 2000 server having IIS 5 and Jrun 3.11." - I see no mention of Samba in your question. You may not use it at all...

    This line: smb://yourWindowsUser:itsPassword@yourInboxHost/ftpinbox/aetna/
    is just a path to some  remote windows share. If this directory is local for that server, where job runs, you may place your local path instead. Try something like 'C:\ftpinbox\aetna\'
    LVL 19

    Expert Comment

    I also think the question is not very clear

    but if the meaning is these files will reside on a linux server and you want to access them using samba, then what you need is enable samba on the server, and create a simple share (with password)

    use this page to do that (Assuming samba is already on the linux server since almost every linux distribution has it nowadays):
    LVL 1

    Accepted Solution

    A couple of other ways to do this. See below for a brief Description of what Samba is and where your question is contradicting...

    1) Do Map Network Drive in your Win2K server and use the format <drive>:\path\to\file .
    2) Assuming the .txt file is present in a ftp server directory, you can use ftp://<ftp-server>/path/to/file.

    expanding on Nopius' Post:

    You don't have to install any Samba variant for Windows (not that i'm aware of :-) ). Basically Samba is a way to see your Linux boxes in the network from your windows machine. For example, if you want to access the share Songs in MyPC computer which is a windows machine, you do the following from the Start-> Run.. of your Windows PC.


    Now what if the Songs directory is present in the Linux machine instead of the Windows machine MyPC? Still you do the same. Lets say the Linux Box's name MyLinux. The following will give access to Songs folder.


    So what actually is the difference? Normally, Windows Machines use the native windows networking protocol (WINS for instance). Linux however, by default is incapable of speaking this language. In order for Linux speak this language and hence make the Songs folder available for you in your windows machine when you do \\MyLinux\Songs, it uses this protocol/software called Samba (smb actually).

    While the Samba Server allows you to share Linux directories to be seen in Windows, The courterpart, Samba Client allows you to access Windows Share in Linux machines. The simplest way to do this is to point your Konqueror Browser to the windows  share using the url format "smb://yourWindowsUser:itsPassword@yourInboxHost/ftpinbox/aetna/".

    So basically means you are trying to access a windows share from a windows PC but using a method that is Linux oriented. This is not required. Instead you can, as Nopius pointed out, use the directly the windows share format of \\somepc\somedirectory or c:\ftpinbox\aetna .

    A couple of other ways to do this:

    1) Do Map Network Drive in your Win2K server and use the format <drive>:\path\to\file .
    2) Assuming the .txt file is present in a ftp server directory, you can use ftp://<ftp-server>/path/to/file.

    Hope this helps.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    759 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