home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / ftpfid17.zip / FTPRPT.CMD < prev    next >
OS/2 REXX Batch file  |  1996-09-08  |  2KB  |  43 lines

  1. /*-------------------------------------------------------------------------*
  2.  * FTPSTAT.CMD                                                            *
  3.  *                                                                         *
  4.  *-------------------------------------------------------------------------*/
  5. ftplog = 'f:\bbs\logs\ftpfido.log'
  6. ftprpt = 'f:\bbs\logs\ftprpt.log'
  7.  
  8.     New=Directory('f:\bbs\logs')
  9.     IF Stream(ftplog,'C', 'Query Exists') <>' ' Then
  10.     Do
  11.     rc = stream(ftplog,'C','open read')
  12.     total_sent = 0
  13.     total_rec = 0
  14.     total_time = 0
  15.     total_sec = 0
  16.     session_total = 0
  17.      do until LINES(ftplog) = 0
  18.       line = LINEIN(ftplog)
  19.        If Pos(' $', line) = 1 then
  20.     Do
  21.       parse var line sent sentmuch bytes dytes recmuch rest ters muchtime mi muchsec se etime
  22.     total_sent = total_sent + sentmuch
  23.     total_rec = total_rec + recmuch
  24.     total_time = total_time + muchtime
  25.     total_sec = total_sec + muchsec
  26.         session_total = session_total + etime
  27.     if total_sec > 59 then 
  28.       do
  29.     total_time = total_time + 1
  30.     total_sec = total_sec - 60
  31.       end
  32.      end
  33.        end /* Do Until */
  34.        total_secs = total_time*60 + total_sec
  35.        total_t = total_sent + total_rec
  36.        appbps = total_t % total_secs
  37.        rc = stream(ftplog,'C','close')
  38.        rc = stream(ftprpt,'C','open write')
  39.        rc = lineout(ftprpt,date('N') 'Todays Stats: 'total_sent 'sent - 'total_rec 'recieved 'total_time 'minutes 'total_sec 'secs. 'appbps 'bps. 'session_total)
  40.        rc = stream(ftprpt,'C','close')
  41.      end
  42.  
  43.