;+
;NAME:
;	go_seq_run_sum
;PURPOSE:
;	Main program driver for SEQ_RUN_SUM to be run in batch
;HISTORY:
;	Written 15-Jan-96 by M.Morrison
;	31-Jan-96 (MDM) - Corrected error which caused a run-away job
;			  (first of the month)
;			- Added RCP command to update the 3 nodes
;	 1-Feb-96 (MDM) - Added calls to CAM_RUN_SUM
;	16-Apr-96 (MDM) - Removed call to SEQ_RUN_SUM
;-
;
if (n_elements(date) eq 0) then date = ut_time()
;
qredone = 0
;
top:
date = gt_day(date,/str)
tarr = anytim2ex(date)
fid = ex2fid(tarr)
outfil1 = '$MDI_CAL_INFO/' + strmid(fid,0,4) + '.seq_run_sum'
outfil2 = '$MDI_CAL_INFO/' + strmid(fid,0,4) + '.cam_run_sum'
;;seq_run_sum, month = strmid(date, 3, 6), outfil=outfil1
cam_run_sum, month = strmid(date, 3, 6), outfil=outfil2
;
if ((tarr(4) eq 1) and (not qredone)) then begin		;first of the month, do the previous month over for completeness
    qredone = 1
    tarr(5) = tarr(5) - 1
    if (tarr(5) eq 0) then begin & tarr(6) = tarr(6)-1 & tarr(5) = 12 & end
    date = fmt_tim(tarr)
    goto, top
end
;
;spawn, 'rcp -p /mdisw/dbase/cal/info/*run_sum    mdibbs:/mdisw/dbase/cal/info
;spawn, 'rcp -p /mdisw/dbase/cal/info/*run_sum    umbra:/mdisw/dbase/cal/info
;spawn, 'rcp -p /mdisw/dbase/cal/info/*run_sum    fault:/mdisw/dbase/cal/info
;
end