If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > batch from window to unix

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-23-04, 13:48
sjumma sjumma is offline
Registered User
 
Join Date: Oct 2003
Posts: 232
Arrow 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
__________________
bigfoots

Last edited by sjumma; 06-23-04 at 14:20.
Reply With Quote
  #2 (permalink)  
Old 06-24-04, 16:40
sjumma sjumma is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 06-24-04, 17:05
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,613
What purpose does the second ftp on that line serve?

-PatP
Reply With Quote
  #4 (permalink)  
Old 06-24-04, 17:09
sjumma sjumma is offline
Registered User
 
Join Date: Oct 2003
Posts: 232
Arrow

adds the server name
__________________
bigfoots
Reply With Quote
  #5 (permalink)  
Old 06-24-04, 17:17
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,613
I'd be very, very surprised if the second ftp in that line did anything useful. Check out KB#96269 for examples.

-PatP
Reply With Quote
  #6 (permalink)  
Old 06-25-04, 12:36
sjumma sjumma is offline
Registered User
 
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
__________________
bigfoots

Last edited by sjumma; 06-25-04 at 15:24.
Reply With Quote
  #7 (permalink)  
Old 06-30-04, 11:07
sjumma sjumma is offline
Registered User
 
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
Reply With Quote
  #8 (permalink)  
Old 06-30-04, 12:23
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,613
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On