Page MenuHomePhabricator

Support @weekly et al in crontab
Closed, ResolvedPublic

Description

The script that parses the crontab to check for jsub invocations breaks when @weekly is used instead of 0 0 * * 0, presumably because it parses by splitting on space.

For example,

@weekly /usr/bin/jsub -N taxonomy -mem 512m -once /data/project/wikibugs/py-wikibugs2/bin/python /data/project/wikibugs/wikibugs2/taxonomy.py > /dev/null

gets mangled into

/usr/bin/jsub -N taxonomy -mem 512m /usr/bin/jsub -N cron-tools.wikibugs-1 -once -quiet -once /data/project/wikibugs/py-wikibugs2/bin/python /data/project/wikibugs/wikibugs2/taxonomy.py > /dev/null

Event Timeline

valhallasw raised the priority of this task from to Needs Triage.
valhallasw updated the task description. (Show Details)
valhallasw added a project: Toolforge.
valhallasw added subscribers: Aklapper, valhallasw.
scfc triaged this task as Lowest priority.Apr 6 2015, 8:05 AM
scfc subscribed.
scfc assigned this task to coren.

WFM:

tools.scfc-test-can-be-deleted-anytime@tools-bastion-03:~$ echo '@weekly true' | crontab && crontab -l

NOTE: some crontab entries have been modified to grid submissions.
      You may want to examine the result with 'crontab -e'.

@weekly  /usr/bin/jsub -N cron-tools.scfc-test-can-be-deleted-anytime-1 -once -quiet true 
tools.scfc-test-can-be-deleted-anytime@tools-bastion-03:~$

For reference, the regex may not be good enough and this could be still an issue. See https://gerrit.wikimedia.org/r/#/c/336998/9/misctools/oge-crontab