; cron job to generate summary soon Full disk listing
;
outdir=(['/sxtdata0','/data0'])(is_member(['sxt'],get_host(/short))) 
outftp=concat_dir(outdir,'/ftp/pub/soon/')
outfil=concat_dir(outftp,'soon_full_disk.txt')

; make the full disk listing
if n_elements(t0) gt 0 then soon_search, t0, t1, /full, outfil=outfil else $
   soon_search, /full, outfil=outfil

html=rd_tfile(outfil)		          ; read file -> html (text array)
ss=where(strlen(html) eq max(strlen(html)))
html=html(ss)
times=strmid(html,74,19)

order=sort(int2secarr(anytim2ints(times)))
html=html(order)

html_dir=concat_dir(get_logenv('path_http'),get_logenv('html_http'))
outhtml=concat_dir(html_dir,'soon_full_disk.html')

; build html file
sxt_html,outhtml,/header
file_append, outhtml, $
  ['<h2> SOONSPOT Full Disk Listing - Generated at: ' + systime() + '</h2><p>']
file_append, outhtml, ['<pre>',html,'</pre>']
sxt_html,outhtml,/trailer

; anon ftp version
file_append,concat_dir(outftp,'soon_full_disk.html'),html,/new	; anon ftp copy
end
