home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 2 BBS
/
02-BBS.zip
/
ftpfid17.zip
/
FTPRPT.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-09-08
|
2KB
|
43 lines
/*-------------------------------------------------------------------------*
* FTPSTAT.CMD *
* *
*-------------------------------------------------------------------------*/
ftplog = 'f:\bbs\logs\ftpfido.log'
ftprpt = 'f:\bbs\logs\ftprpt.log'
New=Directory('f:\bbs\logs')
IF Stream(ftplog,'C', 'Query Exists') <>' ' Then
Do
rc = stream(ftplog,'C','open read')
total_sent = 0
total_rec = 0
total_time = 0
total_sec = 0
session_total = 0
do until LINES(ftplog) = 0
line = LINEIN(ftplog)
If Pos(' $', line) = 1 then
Do
parse var line sent sentmuch bytes dytes recmuch rest ters muchtime mi muchsec se etime
total_sent = total_sent + sentmuch
total_rec = total_rec + recmuch
total_time = total_time + muchtime
total_sec = total_sec + muchsec
session_total = session_total + etime
if total_sec > 59 then
do
total_time = total_time + 1
total_sec = total_sec - 60
end
end
end /* Do Until */
total_secs = total_time*60 + total_sec
total_t = total_sent + total_rec
appbps = total_t % total_secs
rc = stream(ftplog,'C','close')
rc = stream(ftprpt,'C','open write')
rc = lineout(ftprpt,date('N') 'Todays Stats: 'total_sent 'sent - 'total_rec 'recieved 'total_time 'minutes 'total_sec 'secs. 'appbps 'bps. 'session_total)
rc = stream(ftprpt,'C','close')
end