Instructions for configuring a cron job that imports run history records from /daq/run_records/ into ArtdaqDB.

  • Check out the latest sbndaq project code into your MRB area, run a build, followed by the mrb -i; mrbslp command that installs database tools into the $SBNDAQ_DIR/configDB_tools directory.

  • Review $HOME/.artdaq_database_tools.env or create a new one if required. Ask Wes or Gennadiy to send you a working copy of .artdaq_database_tools.env.

  • Setup the sbndaq product from the $MRB_TOP/localProducts_* directory and confirm that the importRunHistory2ArtdaqDB-cron.sh script will execute from $MRB_TOP/localProducts_* by running the which importRunHistory2ArtdaqDB-cron.sh command.

ups list -aK+ sbndaq -z $MRB_TOP/localProducts_*
#$ "sbndaq" "v1_00_01" "Linux64bit+3.10-2.17" "e20:prof:s112" ""
setup "sbndaq" "v1_00_01" -q "e20:prof:s112"
which importRunHistory2ArtdaqDB-cron.sh
#$ ~/DAQ_DevAreas/DAQ_23Nov2021GAL/localProducts_sbndaq_v1_00_01_e20_prof_s112/sbndaq/v1_00_01/configDB_tools/importRunHistory2ArtdaqDB-cron.sh
  • Copy importRunHistory2ArtdaqDB-cron.sh into ${HOME}/cronjobs/.
cp $(which importRunHistory2ArtdaqDB-cron.sh) ${HOME}/cronjobs/ && chmod a+rx ${HOME}/cronjobs/importRunHistory2ArtdaqDB-cron.sh
  • Add or update the crontab entry for importRunHistory2ArtdaqDB-cron.sh with the crontab -e command (uses vi editor).
*/5 * * * * ~/cronjobs/importRunHistory2ArtdaqDB-cron.sh >> /daq/log/dbtools/database-artdaqdb.log 2>&1
  • Wait 6 mins and verify the cronjob runs by running the tail -20 /daq/log/dbtools/database-artdaqdb.log command.