get_crontab_contents module

add_crontab_line(called_from_cron, machine, crontab_line, exptdir, debug) None

Adds crontab line to cron table

Parameters:
  • called_from_cron (bool) – Set this value to True if script is called from within a crontab.

  • machine (str) – The name of the current machine

  • crontab_line (str) – Line to be added to cron table

  • exptdir (str) – Path to the experiment directory

  • debug (bool) – True will give more verbose output

delete_crontab_line(called_from_cron, machine, crontab_line, debug) None

Deletes crontab line after job is complete i.e., either SUCCESS/FAILURE but not IN PROGRESS status

Parameters:
  • called_from_cron (bool) – Set this value to True if script is called from within a crontab

  • machine (str) – The name of the current machine

  • crontab_line (str) – Line to be deleted from cron table

  • debug (bool) – True will give more verbose output

get_crontab_contents(called_from_cron, machine, debug)

This function returns the contents of the user’s cron table, as well as the command used to manipulate the cron table. Typically this latter value will be crontab, but on some platforms the version or location of this may change depending on other circumstances.

Parameters:
  • called_from_cron (bool) – Set this value to True if script is called from within a crontab

  • machine (str) – The name of the current machine

  • debug (bool) – True will give more verbose output

Returns:
  • crontab_cmd (str) – String containing the “crontab” command for this machine

  • crontab_contents (str) – String containing the contents of the user’s cron table.