Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BAT file to FTP to unix server

Status
Not open for further replies.

muralisai25

IS-IT--Management
Jul 20, 2002
51
US
Hi,
I would like to write a DOS batch file that will telnet to a UNIX machine and go to a certain folder and count the number of files of certain format and save the TOTAL COUNT in a file and send that file back to the PC and delete the count file we created from UNIX folder.

I know how to telnet to unix and thats about it. I am not a unix person. There is a catch... The folder name in unix is something like this. /temp/YYMMDD... the folder YYMMDD is the current date when the connection is made to the unix machine... Then i need to count the number of *.HTML files in that folder and save the count in a file and FTP'ed back to my PC.... Does anyone know how to write the unix script or commands in the batch file that wud let me CHECk a folder in UNIX and count the number of files in that folder and send it back to my PC as a text file.
Any help on this would be appreciated.
 
OK ITS me again, I wanted to add more to my post may be that will help... I was reading a UNIX book and i saw someting about a cron JOB.... Is there a way i can write a script to go to a folder count the number of files and output the data to a NEW file in the same folder.

Again the scenario is.... At certain time of the day, a program creates a folder in the UNIX directory... the folder is created with the current dates name..for example if the current date was July 28th...the folder has the name 072802 and then there is a whole bunch of HTML files in it.. WHat i was originally trying to do was.... Telnet to this unix machine from my PC and get the file that is going to have a total count of all the files in that Particular (072802) folder..... Any help wud be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top