Upon further inspection, there are a few more issues with pre-scheduler.
The first being that the pattern is out of order from how the entries are put into the crontab file.
Original Line 111:
Code:
$pattern="\-\-action backup \-\-backup\-set $setname.*\-\-interval $int \-\-backup\-level $lev";
needs to be
Code:
$pattern="\-\-action backup \-\-backup\-set $setname.*\-\-backup\-level $lev \-\-interval $int";
as both the mysql-zrm-scheduler and zrm-pre-scheduler list the options in the order <action><backup-set><backup level><interval>
Next, the section of code where the new cron is written to the temp file needs to be changed. As it is, it generates an entry that looks like this:
Code:
50 16 * * * /usr/bin/zrm-pre-scheduler --action edit --interval daily --delay 1
The original code starting at line 164:
Code:
print OUTF "$min $hr $mday * $wday /usr/bin/$prog ";
print OUTF "--action $myaction ";
print OUTF "--interval $int " if ( $int );
print OUTF "--backup-level $lev " if ( $lev );
print OUTF "--delay $later\n";
needs to change to
Code:
print OUTF "$min $hr $mday * $wday /usr/bin/$prog ";
print OUTF "--action $myaction ";
print OUTF "--action backup ";
print OUTF "--backup-set $setname " if ( $setname);
print OUTF "--backup-level $lev " if (defined $lev );
print OUTF "--interval $int " if ( $int );
print OUTF "--delay $later\n";
Notice that the --backup-lev line is altered to use defined, as the code as it stands will not execute this line for full backups. The other lines could also use defined, however as they do not have an expected value that would eval to FALSE, they should be fine.
The third thing that should be changed is the Regex that finds the cron entry, though this isn't critical.
Original line 116:
Code:
if ( /^([^#].*)\s+([0-9]{1,2})\s+([0-9\*]{1,2})\s+([0-9\*]{1,2})\s+([0-9\*])\s+(.*$pattern\s+)(\-\-delay)\s+([0-9]{1,2})$/ ) {
Updated line 116:
Code:
if ( /^([^#].*)\s+([0-9]{1,2})\s+([0-9\*]{1,2})\s+([0-9\*]{1,2})\s+([0-9\*])\s+(.*$pattern)\s+(\-\-delay)\s+([0-9]{1,2})$/ ) {
What this does is takes the whitespace character out of the 6th capture group (command to execute until --delay). In this case the code as it stands will still work, however subsequent executions add additional spaces between the <interval> and the <delay>.
Hopefully this is helpful to others.