Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2003
    Posts
    232

    Arrow Unanswered: batch from window to unix

    From window machine where i run batch file

    I need to check a directory in Unix for files ( about 600) , whethere they are present or not

    My batch file runs by date ie for tomorrow i would say --> batchfilename 624

    I need to check for files with 624?????.sch ( so i get all 600)


    We need to login to that with username/password to on unix machine

    I dont mind copying it to one folder in windows just for checking

    they are just small files


    Any suggestion
    Last edited by sjumma; 06-23-04 at 15:20.
    bigfoots

  2. #2
    Join Date
    Oct 2003
    Posts
    232

    Lightbulb half way working

    i run a batch file say mybatch and pass on the MDD mybatch 624
    Also viccopy is login commands in txt file

    md victemp
    cd victemp

    rem md tmp

    ftp -i -s:\\servername\directoryl\viccopy.txt ftp servername

    dir c:\victemp\%1?????.sch /o-s
    REM ** THERE SHOULD BE 300 FILES SHOWN ABOVE **


    Pause

    Rem ** THERE SHOULD BE 300 FILES SHOWN ABOVE **
    Rem **Report to salim/Erik their may be missing NMI spots**



    del c:\victemp\%1?????.sch

    cd ..
    rmdir victemp


    There is some error on ftp line any body can check and find out

    viccopy.txt contains the following
    username
    password
    mget /usr/viis/conf/*.sch
    quit
    bigfoots

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    What purpose does the second ftp on that line serve?

    -PatP

  4. #4
    Join Date
    Oct 2003
    Posts
    232

    Arrow

    adds the server name
    bigfoots

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'd be very, very surprised if the second ftp in that line did anything useful. Check out KB#96269 for examples.

    -PatP

  6. #6
    Join Date
    Oct 2003
    Posts
    232
    You are correct Now it takes username and password it is not taking

    ftp -i -s:\\servername\directoryl\command.txt remoteservername


    user
    password
    cd /usr/viis/conf/binary
    mget *.* (how do i pass on value) which is tomorrow from the date its pulled out my files are named MDD?????.SCH
    bye
    Last edited by sjumma; 06-25-04 at 16:24.
    bigfoots

  7. #7
    Join Date
    Oct 2003
    Posts
    232

    Arrow help

    How do i pass the date from text file,

    i can call a text file from batch file and log on to unix computer

    how do i pass a date to unix computer

    1)My file e.g 61207012.sch
    first 3 numbers are M(month) DD (DAY)
    How do i pass a value from window batch file ???
    __________________
    bigfoots

  8. #8
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I don't think that the NT batch language is robust enough to get that job done.

    Within SQL Server, DTS is probably the simplest answer. You can combine Active-X script (essentially VBA) with "canned" FTP tasks to make this process pretty simple.

    You could install a more powerful scripting language like Perl or PHP. They include the tools needed to make this relatively simple. This is probably the most generic answer, since you can run both Perl and PHP on either Windows or Unix, so the commonality will probably make things much simpler.

    If you want to do this at a still lower level, you could code it in VB, VC, or another language.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •