https:///weradocs/mkcron.shtml Last update:

WERA HF Radar Software - mkcron - handle crontab entries

mkcron reads and interprets control parameters from the extended header (XHeader) file.
mkcron generates entries into the wera crontab file if a continuous measurement is requested by WeraDesk.
The setting start_acq==0 && finish_acq==1 requests mkcron to remove the entries from the crontab file.
In case of single acquisition, the measurement is started by calling stm from mkcron directly.
mkcron also modifies the file Crontab.html to reflect the actual state of the crontab file.

The syntax for calling mkcron is:

Fortran:
         SYS_STAT = SYSTEM('nohup /home/wera/weractrl/mkcron '//
     *                '/home/wera/weractrl/ctrl_data.cpy '//
     *                '/home/wera/weractrl/cron_hawaii '//
     *                '/home/wera/weractrl/cron_hawaii.log > /dev/zero &')

Unix command line:
$ mkcron /path/to/xheader_file /path/to/crontab_file /path/to/log_file

The following lines show a typical crontab entry:

wera@ifmwera2:~/weractrl> crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/home/wera/weractrl/cron_hawaii installed on Thu Jan  2 18:27:37 2003)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
#Start - WERA automatic crontab entry
0,10,20,30,40,50,0 * * * * /home/wera/weractrl/stm /home/wera/weractrl/ctrl_data.cpy /home/wera/weractrl/cron_hawaii s > /home/wera/weractrl/cron_hawaii.log
#End --- WERA automatic crontab entry

The basic functions of mkcron are as follows:


/* --- Read eXtended header (XHeader, 1147 Byte) ------------------------ */
/* ---------------------------------------------------------------------- */

/* --- Get required measurement mode ------------------------------------ */
/* ---------------------------------------------------------------------- */

/* --- Start acquisition ------- */
/* start_acq==1 && finish_acq==0 */

  //  SNGL1 && CONT0

  /*  --- Single Acquisition, remove automatic crontab entry ------------ */
  /*  ------------------------------------------------------------------- */

  // send message to WeraDesk Status (Crontab.html)
  sprintf(CRONmessage,"Disabled  \0");

  printf("mkcron: Start Single Acqusition. \n");

  //    SNGL0 && CONT0 or SNGL0 && CONT1 or SNGL1 && CONT1

  /* --- Prepare Continuous Acquisition with crontab file --------------- */
  /* -------------------------------------------------------------------- */

  /* Install crontab entry */

  // send message to WeraDesk Status (Crontab.html)
  sprintf(CRONmessage,"Active    \0");

/* --- Stop acquisition -------- */
/* start_acq==0 && finish_acq==1 */

   if(cdat.wacqtyp[0].on_off[0] == '1' &&    // SNGL1 && CONT0 && TEST1,
      cdat.wacqtyp[1].on_off[0] == '0' &&    // i.e. TEST case
      cdat.wacqtyp[2].on_off[0] == '1')
      {
      printf("-------------------------------- \n");
      printf("mkcron: TEST stop: call stm.     \n");
      printf("-------------------------------- \n");
      }

  /* --- Stop Continuous Acquisition in crontab  ------------------------ */
  /* -------------------------------------------------------------------- */

  // send message to WeraDesk Status (Crontab.html)
  sprintf(CRONmessage,"Disabled  \0");

/* start_acq==0 && finish_acq==0 */

/* --- Keep current status  --------------------------------------------- */
/* ---------------------------------------------------------------------- */

/* start_acq==1 && finish_acq==1 */

fprintf(stderr,"Wrong status in %s !\n",nam1);


Comments to: gurgel@ifm.uni-hamburg.de (Klaus-Werner Gurgel)