Uploaded image for project: 'Product Technical Learning'
  1. Product Technical Learning
  2. PTL-5809

RH134-442: crontab lab grades based upon crontab syntax (and gets it wrong)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • RH134 - RHEL9.0-en-2-20220609
    • RH134
    • None
    • ILT, ROLE, VT
    • de-DE (German), en-US (English), es-ES (Spanish), fr-FR (French), ja-JP (Japanese), ko-KR (Korean), pt-BR (Portuguese, Brazilian), zh-CN (Chinese, Simplified), zh-TW (Chinese, Traditional)

      URL:
      Reporter RHNID:
      Section: -
      Language: de-DE (German)|en-US (English)|es-ES (Spanish)|fr-FR (French)|ja-JP (Japanese)|ko-KR (Korean)|pt-BR (Portuguese, Brazilian)|zh-CN (Chinese, Simplified)|zh-TW (Chinese, Traditional)
      Workaround:

      Description: RH134, comp review (and probably also RH199 comp review).

      The lab states: "6. On serverb, schedule a recurring job as the student user that executes the /home/student/backup-home.sh script on an hourly basis between 7 PM and 9 PM on all days except Saturday and Sunday. Use the backup-home.sh script to schedule the recurring job. `Download the backup script from http://materials.example.com/labs/backup-home.sh.`"

      The given answer is: 0 19-21 * * Mon-Fri /home/student/backup-home.sh

      Ricardo has observed that the answer of 0 19-21 * * 1-5 /home/student/backup-home.sh is marked as False (in spite of man 5 crontab suggesting that day NUMBERS be used, and yes, it also states names further on in the man page...)

      Apparently the grading script is parsing the crontab and looking specifically for days. This is dangerous, and incorrect. The crontab entry for day(s) allows for either day number or day of the week, or any combination thereof!!!

      So ... 1-Fri does work.

      As does 1,2,Wed,4,Fri
      As does 2,1,3,Fri,4
      Note that 2,1,3,Fri,5 would pass crontab, but would fail your requirements (no Thursday).

      So, your grading script needs to accept:

      • range of days numeric
      • range of days by name
      • range of days (one numeric, one name)
      • A list of the days, each day can be either a numeric or by name, and all days need to be listed.
      • any combination of lists and ranges (e.g. 1,Tue,3-Fri) so long as monday thru Friday are covered (at least once each), and Saturday and Sunday are not covered.

            rht-pagomez Patrick Gomez
            ghosler Greg Hosler (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: