Results 1 to 3 of 3

Thread: zrm-pre-scheduler still fills up crontab

  1. #1

    Default zrm-pre-scheduler still fills up crontab

    At every run zrm-pre-scheduler rewrites the crontab. In our installation this used to lead to heaps of comments on top of the crontab like

    Code:
    # DO NOT EDIT THIS FILE - edit the master and reinstall.
    # (/tmp/zrm-prescheduler40ec7 installed on Wed Jul 25 02:00:03 2007)
    # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
    # (/tmp/zrm-preschedulerdsI0f installed on Wed Jul 25 02:00:03 2007)
    # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
    # (/tmp/zrm-prescheduler1ajeK installed on Wed Jul 25 02:00:03 2007)
    ...
    After updating to Version 1.2 of mysql-zrm only half of the bogus lines remain:

    Code:
    # DO NOT EDIT THIS FILE - edit the master and reinstall.
    # (/tmp/zrm-preschedulerUHxKM installed on Wed Jul 25 13:30:02 2007)
    # (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
    # (/tmp/zrm-preschedulerdsI0f installed on Wed Jul 25 02:00:03 2007)
    # (/tmp/zrm-prescheduler1ajeK installed on Wed Jul 25 02:00:03 2007)
    # (/tmp/zrm-preschedulerpUGjJ installed on Wed Jul 25 02:00:03 2007)
    ...
    I found that in /usr/bin/zrm-pre-scheduler there is code that tries to filter these lines from the temporary file that will serve as input for the crontab command. We have in line 136
    Code:
    /^# DO NOT EDIT.*/ || /^# \(\/tmp\/crontab.*/ || /^# \(Cron version --.*/
    and 176:
    Code:
    /^# DO NOT EDIT.*/ || /^# \(\/tmp\/.*crontab.*/ || /^# \(Cron version .*/
    (I wonder why they are different ... )

    The filter for Cron version in line 176 works now, that's why only half of the lines remain.
    Unfortunately, the filter for /tmp/.*crontab or /tmp/crontab cannot match, because zrm-pre-scheduler installs its crontabs from /tmp/zrm-prescheduler*, not from a file or directory beginning with or containing the string crontab.

    Can't we change either the temp file pattern of zrm-pre-scheduler to contain something like crontab or the regex to match the entries as they are, so that these comments aren't infinitely copied?

    Kind regards, Holger

  2. #2
    Join Date
    Oct 2005
    Location
    Bay Area, CA
    Posts
    124

    Default

    Thanks for the report. We'll fix the regex to filter out the comment properly in the next release.

  3. #3

    Default

    Thanks for the fast response. I'll make an interim fix for our site, but looking forward to the next release.
    Kind regards
    Holger

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •