It's UWAweek 48


This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

Displaying selected article
Showing 1 of 919 articles.
Currently 4 other people reading this forum.

 UWA week 37 (2nd semester, week 7) ↓
SVG not supported

Login to reply


> Do I iterate through every single line in crontab-file, testing if the minute and hour are equal to the current minute and hour? Or if the crontab hour is a "*" and the current minute is 0? etc. This doesn't seem efficient, there would have to be a dozen "if-or-or-or" statements to account for the multiple different combinations of "*" characters and integer entries that could lead to the current minute being a valid time for a process to be started.
That's about the simplest approach - iterate through each of the 40K+ minutes of the month, checking to see if any of the crontab entries match the current time/date. Do not worry about efficiency for your first 'attempt' - in fact don't worry about efficiency at all (unless your execution time is horrendous). Your desktop or laptop computer can perform at least 1 BILLION comparisons per second, so it's unlikely you'll even be able to develop a slow solution!

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  1:17AM Sep 14 2022
Privacy policy