@opsdb
;+
;NAME:
;	go_mk_opsdb_list
;PURPOSE:
;	To dump the current status of the database into a text file.
;	The job is intended to run as a cron job every hour
;HISTORY:
;	Written 16-Jan-96 by M.Morrison
;	25-Jan-96 (MDM) - added /sort_id to the "all" listings
;			- added /sort_lab to the "active" listings
;	31-Jan-96 (MDM) - Added RCP commands to distribute the files
;	25-Apr-96 (MDM) - Added making RDB files (two more calls to OPSDB_PRINT)
;        7-Aug-96 (MDM) - Removed rcp, added trig_mirror
;	 8-Aug-96 (MDM) - Added creation of latest two TFR file listings
;	19-Aug-96 (MDM) - Added creation of IPREG and QADR
;	 9-Nov-99 (RIB) - Removed trig_mirror command - to be run in a separate
;                         cron job
;-
;
;
setenv, 'MDI_OPSDB_TYPE=PREP'
;
opsdb_print, /cam, /sort_id,		outfil='$MDI_CAL_INFO/opsdb_all.cam'
opsdb_print, /obs, /sort_id,		outfil='$MDI_CAL_INFO/opsdb_all.obs'
;
opsdb_print, /cam, /active, /sort_lab,	outfil='$MDI_CAL_INFO/opsdb_active.cam'
opsdb_print, /obs, /active, /sort_lab,	outfil='$MDI_CAL_INFO/opsdb_active.obs'
;
opsdb_print, /ipreg, /active, /sort_addr,	outfil='$MDI_CAL_INFO/opsdb_active.ipreg'
opsdb_print, /qadr, /active, /sort_addr,	outfil='$MDI_CAL_INFO/opsdb_active.qadr'
;
opsdb_print, /all,			outfil='$MDI_CAL_INFO/opsdb_all.everything'
;
opsdb_print, xx, 20, /cam, /noheader,	outfil='$MDI_CAL_INFO/opsdb_cam_files.rdb'
opsdb_print, xx, 20, /obs, /noheader,	outfil='$MDI_CAL_INFO/opsdb_obs_files.rdb'

list_tfi, get_last_tfr(0), outfil='$MDI_CAL_INFO/last0.list_tfi
list_tfi, get_last_tfr(1), outfil='$MDI_CAL_INFO/last1.list_tfi
list_tfi, get_last_tfr(2), outfil='$MDI_CAL_INFO/last2.list_tfi

;spawn, 'trig_mirror /mdisw/dbase/cal/info
;spawn, 'rcp -p /mdisw/dbase/cal/info/opsdb*    mdibbs:/mdisw/dbase/cal/info
;spawn, 'rcp -p /mdisw/dbase/cal/info/opsdb*    umbra:/mdisw/dbase/cal/info
;spawn, 'rcp -p /mdisw/dbase/cal/info/opsdb*    fault:/mdisw/dbase/cal/info

end
